Skip to content

Commit 997381b

Browse files
Fixed the tag issue
1 parent 25d46e1 commit 997381b

2 files changed

Lines changed: 22 additions & 17 deletions

File tree

infra/main.bicep

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -234,15 +234,17 @@ var deployerPrincipalType = contains(deployer(), 'userPrincipalName') ? 'User' :
234234
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
235235
name: 'default'
236236
properties: {
237-
tags: {
238-
...resourceGroup().tags
239-
...allTags
240-
TemplateName: 'MACAE'
241-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
242-
CreatedBy: createdBy
243-
DeploymentName: deployment().name
244-
SolutionSuffix: solutionSuffix
245-
}
237+
tags: union(
238+
resourceGroup().tags ?? {},
239+
allTags,
240+
{
241+
TemplateName: 'MACAE'
242+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
243+
CreatedBy: createdBy
244+
DeploymentName: deployment().name
245+
SolutionSuffix: solutionSuffix
246+
}
247+
)
246248
}
247249
}
248250

infra/main_custom.bicep

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,17 @@ var deployerPrincipalType = contains(deployer(), 'userPrincipalName') ? 'User' :
233233
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
234234
name: 'default'
235235
properties: {
236-
tags: {
237-
...allTags
238-
TemplateName: 'MACAE'
239-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
240-
CreatedBy: createdBy
241-
DeploymentName: deployment().name
242-
SolutionSuffix: solutionSuffix
243-
}
236+
tags: union(
237+
resourceGroup().tags ?? {},
238+
allTags,
239+
{
240+
TemplateName: 'MACAE'
241+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
242+
CreatedBy: createdBy
243+
DeploymentName: deployment().name
244+
SolutionSuffix: solutionSuffix
245+
}
246+
)
244247
}
245248
}
246249

0 commit comments

Comments
 (0)