Skip to content

Commit 22f2114

Browse files
Merge pull request #526 from microsoft/psl-Createbytag-v3
fix: Update Created by tag logic to dev-v3 branch
2 parents 407b9cb + 4339834 commit 22f2114

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

infra/main.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ var allTags = union(
223223
},
224224
tags
225225
)
226-
@description('Optional created by user name')
227-
param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0]
226+
@description('Tag, Created by user name')
227+
param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId
228228

229229
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
230230
name: 'default'

infra/main_custom.bicep

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ var allTags = union(
223223
},
224224
tags
225225
)
226-
@description('Optional created by user name')
227-
param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0]
226+
@description('Tag, Created by user name')
227+
param createdBy string = contains(deployer(), 'userPrincipalName')? split(deployer().userPrincipalName, '@')[0]: deployer().objectId
228228

229229
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
230230
name: 'default'

0 commit comments

Comments
 (0)