Skip to content

Commit 9fc1059

Browse files
Call the variable outside the resource
1 parent fa03e4b commit 9fc1059

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

infra/main.bicep

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,11 +174,13 @@ var allTags = union(
174174
tags
175175
)
176176

177+
var existingTags = resourceGroup().tags ?? {}
178+
177179
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
178180
name: 'default'
179181
properties: {
180182
tags: union(
181-
resourceGroup().tags ?? {},
183+
existingTags,
182184
tags,
183185
{
184186
TemplateName: 'Container Migration'

infra/main_custom.bicep

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,13 @@ var allTags = union(
153153
tags
154154
)
155155

156+
var existingTags = resourceGroup().tags ?? {}
157+
156158
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
157159
name: 'default'
158160
properties: {
159161
tags: union(
160-
resourceGroup().tags ?? {},
162+
existingTags,
161163
tags,
162164
{
163165
TemplateName: 'Container Migration'

0 commit comments

Comments
 (0)