Skip to content

Commit 18f6d1d

Browse files
fixed the tag issue
1 parent b9053ae commit 18f6d1d

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

infra/main.bicep

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@ param createdBy string = contains(deployer(), 'userPrincipalName')? split(deploy
157157
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
158158
name: 'default'
159159
properties: {
160-
tags: {
161-
...resourceGroup().tags
162-
...allTags
163-
TemplateName: 'Code Modernization'
164-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
165-
CreatedBy: createdBy
166-
}
160+
tags: union(
161+
resourceGroup().tags ?? {},
162+
{
163+
TemplateName: 'Code Modernization'
164+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
165+
CreatedBy: createdBy
166+
},
167+
tags
168+
)
167169
}
168170
}
169171

infra/main_custom.bicep

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,15 @@ param createdBy string = contains(deployer(), 'userPrincipalName')? split(deploy
159159
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
160160
name: 'default'
161161
properties: {
162-
tags: {
163-
...resourceGroup().tags
164-
...allTags
165-
TemplateName: 'Code Modernization'
166-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
167-
CreatedBy: createdBy
168-
}
162+
tags: union(
163+
resourceGroup().tags ?? {},
164+
{
165+
TemplateName: 'Code Modernization'
166+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
167+
CreatedBy: createdBy
168+
},
169+
tags
170+
)
169171
}
170172
}
171173

0 commit comments

Comments
 (0)