From 6dcfe525da249ca343331c2d9bc56f220837681c Mon Sep 17 00:00:00 2001 From: "Niraj Chaudhari (Persistent Systems Inc)" Date: Fri, 5 Sep 2025 15:57:06 +0530 Subject: [PATCH] Adding a hardcoded createdBy parameter to the deploy.yml file to prevent validation pipeline failures caused by the deployer function in the Bicep file. --- .github/workflows/deploy.yml | 1 + infra/main.bicep | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 82f0941b1..11f4dd947 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -137,6 +137,7 @@ jobs: imageTag="${IMAGE_TAG}" \ azureAiServiceLocation='${{ env.AZURE_LOCATION }}' \ gptModelCapacity=150 \ + createdBy="Pipeline" \ --output json - name: Extract Web App and API App URLs diff --git a/infra/main.bicep b/infra/main.bicep index 56589a8d2..8bedd7894 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -165,20 +165,23 @@ var replicaLocation = replicaRegionPairs[location] // Resources // // ============== // -var deployerInfo = deployer() + var allTags = union( { 'azd-env-name': solutionName }, tags ) +@description('Optional created by user name') +param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0] + resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = { name: 'default' properties: { tags: { ...allTags TemplateName: 'MACAE' - CreatedBy: split(deployerInfo.userPrincipalName, '@')[0] + CreatedBy: createdBy } } }