Skip to content

Commit 8138165

Browse files
fix: Adding a hardcoded createdBy parameter to the CAdeploy.yml file to prevent validation pipeline failures caused by the deployer function in the Bicep file. (#659)
* Adding a hardcoded createdBy parameter to the CAdeploy.yml file to prevent validation pipeline failures caused by the deployer function in the Bicep file. * Consolidate parameters in CAdeploy.yml
1 parent c900215 commit 8138165

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/CAdeploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ jobs:
144144
DEPLOY_OUTPUT=$(az deployment group create \
145145
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
146146
--template-file infra/main.bicep \
147-
--parameters aiDeploymentsLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} \
147+
--parameters aiDeploymentsLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" \
148148
--query "properties.outputs" -o json)
149149
150150
echo "Deployment output: $DEPLOY_OUTPUT"

infra/main.bicep

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,17 @@ param tags resourceInput<'Microsoft.Resources/resourceGroups@2025-04-01'>.tags =
177177

178178
var aiFoundryAiServicesAiProjectResourceName = 'proj-${solutionSuffix}'
179179

180-
var deployerInfo = deployer()
180+
@description('Optional created by user name')
181+
param createdBy string = empty(deployer().userPrincipalName) ? '' : split(deployer().userPrincipalName, '@')[0]
182+
181183
// ========== Resource Group Tag ========== //
182184
resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
183185
name: 'default'
184186
properties: {
185187
tags: {
186188
...tags
187189
TemplateName: 'Client Advisor'
188-
CreatedBy: split(deployerInfo.userPrincipalName, '@')[0]
190+
CreatedBy: createdBy
189191
}
190192
}
191193
}

0 commit comments

Comments
 (0)