Skip to content

Commit 507be23

Browse files
Merge pull request #348 from microsoft/psl-tag-issue
fix: Resolved the tag issue
2 parents b9053ae + c5b54fc commit 507be23

3 files changed

Lines changed: 97 additions & 80 deletions

File tree

infra/main.bicep

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@ param azureExistingAIProjectResourceId string = ''
118118
@description('Optional. Use this parameter to use an existing Log Analytics workspace resource ID. Defaults to empty string.')
119119
param existingLogAnalyticsWorkspaceId string = ''
120120

121+
var existingTags = resourceGroup().tags ?? {}
122+
121123
var allTags = union(
122124
{
123125
'azd-env-name': solutionName
@@ -157,13 +159,15 @@ param createdBy string = contains(deployer(), 'userPrincipalName')? split(deploy
157159
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
158160
name: 'default'
159161
properties: {
160-
tags: {
161-
...resourceGroup().tags
162-
...allTags
163-
TemplateName: 'Code Modernization'
164-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
165-
CreatedBy: createdBy
166-
}
162+
tags: union(
163+
existingTags,
164+
allTags,
165+
{
166+
TemplateName: 'Code Modernization'
167+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
168+
CreatedBy: createdBy
169+
}
170+
)
167171
}
168172
}
169173

0 commit comments

Comments
 (0)