Skip to content

Commit 5c11a44

Browse files
added template name condition based
1 parent bbe5994 commit 5c11a44

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

.github/workflows/CAdeploy.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,7 @@ jobs:
106106
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
107107
if [ "$rg_exists" = "false" ]; then
108108
echo "Resource group does not exist. Creating..."
109-
110-
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
111-
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
112-
az group create --name ${{ env.RESOURCE_GROUP_NAME }} \
113-
--location ${{ env.AZURE_LOCATION }} \
114-
--tags "CreatedBy=Pipeline" \
115-
"Purpose=Deploying and Cleaning Up Resources for Validation" \
116-
"CreatedDate=$current_date" \
117-
"ApplicationName=Client Advisor" \
118-
|| { echo "Error creating resource group"; exit 1; }
109+
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location ${{ env.AZURE_LOCATION }} || { echo "Error creating resource group"; exit 1; }
119110
else
120111
echo "Resource group already exists."
121112
fi
@@ -151,10 +142,13 @@ jobs:
151142
# Install azd (Azure Developer CLI) - required by process_sample_data.sh
152143
curl -fsSL https://aka.ms/install-azd.sh | bash
153144
145+
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
146+
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
147+
154148
DEPLOY_OUTPUT=$(az deployment group create \
155149
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
156150
--template-file infra/main.bicep \
157-
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} containerImageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore'}" \
151+
--parameters location=${{ env.AZURE_LOCATION }} azureAiServiceLocation=${{ env.AZURE_LOCATION }} solutionName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} containerImageTag=${{ env.IMAGE_TAG }} createdBy="Pipeline" tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}" \
158152
--query "properties.outputs" -o json)
159153
160154
echo "Deployment output: $DEPLOY_OUTPUT"

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ resource resourceGroupTags 'Microsoft.Resources/tags@2021-04-01' = {
284284
properties: {
285285
tags: {
286286
...tags
287-
TemplateName: 'Client Advisor'
287+
TemplateName: enablePrivateNetworking ? 'Client_Advisor_WAF' : 'Client Advisor'
288288
CreatedBy: createdBy
289289
}
290290
}

0 commit comments

Comments
 (0)