File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.' )
119119param existingLogAnalyticsWorkspaceId string = ''
120120
121+ var existingTags = resourceGroup ().tags ?? {}
122+
121123var allTags = union (
122124 {
123125 'azd-env-name' : solutionName
@@ -158,7 +160,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
158160 name : 'default'
159161 properties : {
160162 tags : union (
161- resourceGroup (). tags ?? {} ,
163+ existingTags ,
162164 allTags ,
163165 {
164166 TemplateName : 'Code Modernization'
Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ param azureExistingAIProjectResourceId string = ''
120120@description ('Optional. Use this parameter to use an existing Log Analytics workspace resource ID. Defaults to empty string.' )
121121param existingLogAnalyticsWorkspaceId string = ''
122122
123+ var existingTags = resourceGroup ().tags ?? {}
124+
123125var allTags = union (
124126 {
125127 'azd-env-name' : solutionName
@@ -154,20 +156,21 @@ var modelDeployment = {
154156@description ('Optional. Tag, Created by user name. Defaults to user principal name or object ID.' )
155157param createdBy string = contains (deployer (), 'userPrincipalName' )? split (deployer ().userPrincipalName , '@' )[0 ]: deployer ().objectId
156158
159+ var resourceGroupTagsValue = union (
160+ existingTags ,
161+ allTags ,
162+ {
163+ TemplateName : 'Code Modernization'
164+ Type : enablePrivateNetworking ? 'WAF' : 'Non-WAF'
165+ CreatedBy : createdBy
166+ }
167+ )
157168
158169// ========== Resource Group Tag ========== //
159170resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
160171 name : 'default'
161172 properties : {
162- tags : union (
163- resourceGroup ().tags ?? {},
164- allTags ,
165- {
166- TemplateName : 'Code Modernization'
167- Type : enablePrivateNetworking ? 'WAF' : 'Non-WAF'
168- CreatedBy : createdBy
169- }
170- )
173+ tags : resourceGroupTagsValue
171174 }
172175}
173176
You can’t perform that action at this time.
0 commit comments