Skip to content

Commit 34af4e5

Browse files
Merge pull request #715 from microsoft/psl-tag-issue
fix: Resolved the tag issue
2 parents 5953bca + 3c78db4 commit 34af4e5

2 files changed

Lines changed: 14 additions & 10 deletions

File tree

content-gen/infra/main.bicep

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@ var imageModelDeployment = imageModelChoice != 'none' ? [
247247
var aiFoundryAiServicesModelDeployment = concat(baseModelDeployments, imageModelDeployment)
248248

249249
var aiFoundryAiProjectDescription = 'Content Generation AI Foundry Project'
250+
var existingTags = resourceGroup().tags ?? {}
250251

251252
// ============== //
252253
// Resources //
@@ -275,13 +276,15 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT
275276
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
276277
name: 'default'
277278
properties: {
278-
tags: {
279-
...resourceGroup().tags
280-
... tags
281-
TemplateName: 'ContentGen'
282-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
283-
CreatedBy: createdBy
284-
}
279+
tags: union(
280+
existingTags,
281+
tags,
282+
{
283+
TemplateName: 'ContentGen'
284+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
285+
CreatedBy: createdBy
286+
}
287+
)
285288
}
286289
}
287290

content-gen/infra/main.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.40.2.10011",
9-
"templateHash": "8403017938611050215"
9+
"templateHash": "18177824041085730709"
1010
},
1111
"name": "Intelligent Content Generation Accelerator",
1212
"description": "Solution Accelerator for multimodal marketing content generation using Microsoft Agent Framework.\n"
@@ -308,6 +308,7 @@
308308
"imageModelDeployment": "[if(not(equals(parameters('imageModelChoice'), 'none')), createArray(createObject('format', 'OpenAI', 'name', variables('imageModelConfig')[parameters('imageModelChoice')].name, 'model', variables('imageModelConfig')[parameters('imageModelChoice')].name, 'sku', createObject('name', variables('imageModelConfig')[parameters('imageModelChoice')].sku, 'capacity', parameters('imageModelCapacity')), 'version', variables('imageModelConfig')[parameters('imageModelChoice')].version, 'raiPolicyName', 'Microsoft.Default')), createArray())]",
309309
"aiFoundryAiServicesModelDeployment": "[concat(variables('baseModelDeployments'), variables('imageModelDeployment'))]",
310310
"aiFoundryAiProjectDescription": "Content Generation AI Foundry Project",
311+
"existingTags": "[coalesce(resourceGroup().tags, createObject())]",
311312
"logAnalyticsWorkspaceResourceName": "[format('log-{0}', variables('solutionSuffix'))]",
312313
"applicationInsightsResourceName": "[format('appi-{0}', variables('solutionSuffix'))]",
313314
"userAssignedIdentityResourceName": "[format('id-{0}', variables('solutionSuffix'))]",
@@ -364,7 +365,7 @@
364365
"apiVersion": "2021-04-01",
365366
"name": "default",
366367
"properties": {
367-
"tags": "[shallowMerge(createArray(resourceGroup().tags, parameters('tags'), createObject('TemplateName', 'ContentGen', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy'))))]"
368+
"tags": "[union(variables('existingTags'), parameters('tags'), createObject('TemplateName', 'ContentGen', 'Type', if(parameters('enablePrivateNetworking'), 'WAF', 'Non-WAF'), 'CreatedBy', parameters('createdBy')))]"
368369
}
369370
},
370371
"aiSearchFoundryConnection": {
@@ -14019,8 +14020,8 @@
1401914020
},
1402014021
"dependsOn": [
1402114022
"aiFoundryAiServices",
14022-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
1402314023
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
14024+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
1402414025
"virtualNetwork"
1402514026
]
1402614027
},

0 commit comments

Comments
 (0)