Skip to content

Commit 2e40d83

Browse files
Add CreatedBy tag to resource group
1 parent 9a9af0d commit 2e40d83

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

infra/main.bicep

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,8 @@ var modelDeployment = {
134134

135135
var abbrs = loadJsonContent('./abbreviations.json')
136136

137-
137+
@description('Optional created by user name')
138+
param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0]
138139

139140
// ========== Resource Group Tag ========== //
140141
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
@@ -143,7 +144,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
143144
tags: {
144145
...allTags
145146
TemplateName: 'Code Modernization'
146-
147+
CreatedBy: createdBy
147148
}
148149
}
149150
}

0 commit comments

Comments
 (0)