diff --git a/.github/workflows/RAdeploy.yml b/.github/workflows/RAdeploy.yml index 9ce1a2fd3..0a90e379f 100644 --- a/.github/workflows/RAdeploy.yml +++ b/.github/workflows/RAdeploy.yml @@ -104,7 +104,7 @@ jobs: az deployment group create \ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \ --template-file infra/bicep/main.bicep \ - --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} + --parameters solutionPrefix=${{ env.SOLUTION_PREFIX }} createdBy="Pipeline" - name: List KeyVaults and Store in Array id: list_keyvaults run: | diff --git a/infra/bicep/main.bicep b/infra/bicep/main.bicep index 42829d80a..6b5665d09 100644 --- a/infra/bicep/main.bicep +++ b/infra/bicep/main.bicep @@ -16,14 +16,15 @@ var subscriptionId = subscription().subscriptionId var solutionLocation = resourceGroupLocation var baseUrl = 'https://raw.githubusercontent.com/microsoft/Build-your-own-copilot-Solution-Accelerator/byoc-researcher/' -var deployerInfo = deployer() +@description('Optional created by user name') +param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0] // ========== Resource Group Tag ========== // resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { name: 'default' properties: { tags: { TemplateName: 'Research Assistant' - CreatedBy: split(deployerInfo.userPrincipalName, '@')[0] + CreatedBy: createdBy } } }