Skip to content

Commit fa03e4b

Browse files
Fixed the tag issue
1 parent 9f0b9f0 commit fa03e4b

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
@@ -177,13 +177,15 @@ var allTags = union(
177177
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
178178
name: 'default'
179179
properties: {
180-
tags: {
181-
...resourceGroup().tags
182-
...tags
183-
TemplateName: 'Container Migration'
184-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
185-
CreatedBy: deployerIdentityName
186-
}
180+
tags: union(
181+
resourceGroup().tags ?? {},
182+
tags,
183+
{
184+
TemplateName: 'Container Migration'
185+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
186+
CreatedBy: deployerIdentityName
187+
}
188+
)
187189
}
188190
}
189191

infra/main_custom.bicep

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,15 @@ var allTags = union(
156156
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
157157
name: 'default'
158158
properties: {
159-
tags: {
160-
...resourceGroup().tags
161-
...tags
162-
TemplateName: 'Container Migration'
163-
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
164-
CreatedBy: createdBy
165-
}
159+
tags: union(
160+
resourceGroup().tags ?? {},
161+
tags,
162+
{
163+
TemplateName: 'Container Migration'
164+
Type: enablePrivateNetworking ? 'WAF' : 'Non-WAF'
165+
CreatedBy: createdBy
166+
}
167+
)
166168
}
167169
}
168170

0 commit comments

Comments
 (0)