77 - dev
88 - demo
99 schedule :
10- - cron : ' 0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
10+ - cron : " 0 6,18 * * *" # Runs at 6:00 AM and 6:00 PM GMT
1111
1212env :
1313 GPT_MIN_CAPACITY : 200
2929 steps :
3030 - name : Checkout
3131 uses : actions/checkout@v4
32-
3332 - name : Install ODBC Driver 18 for SQL Server
3433 run : |
3534 curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
8180
8281 - name : Install Bicep CLI
8382 run : az bicep install
84-
8583 - name : Set Deployment Region
8684 id : set_region
8785 run : |
9896 UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
9997 echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
10098 echo "Generated RESOURCE_GROUP_NAME: ${UNIQUE_RG_NAME}"
101-
10299 - name : Check and Create Resource Group
103100 id : check_create_rg
104101 run : |
@@ -114,7 +111,6 @@ jobs:
114111 fi
115112 # Set output for other jobs
116113 echo "RESOURCE_GROUP_NAME=${{ env.RESOURCE_GROUP_NAME }}" >> $GITHUB_OUTPUT
117-
118114 - name : Generate Unique Solution Prefix
119115 id : generate_solution_prefix
120116 run : |
@@ -137,7 +133,6 @@ jobs:
137133 else TAG="latest"; fi
138134 echo "IMAGE_TAG=$TAG" >> $GITHUB_ENV
139135 echo "Image Tag: $TAG"
140-
141136 - name : Deploy and extract values from deployment output
142137 id : get_output
143138 run : |
@@ -152,16 +147,14 @@ jobs:
152147 --parameters aiDeploymentsLocation=${{ env.AZURE_LOCATION }} environmentName=${{ env.SOLUTION_PREFIX }} cosmosLocation=westus gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} imageTag=${{ env.IMAGE_TAG }} \
153148 --query "properties.outputs" -o json)
154149
155-
156-
157150 echo "Deployment output: $DEPLOY_OUTPUT"
158151 if [[ -z "$DEPLOY_OUTPUT" ]]; then
159152 echo "Error: Deployment output is empty. Please check the deployment logs."
160153 exit 1
161154 fi
162155
163- export AI_FOUNDARY_NAME =$(echo "$DEPLOY_OUTPUT" | jq -r '.aI_FOUNDRY_NAME .value')
164- echo "AI_FOUNDARY_NAME=$AI_FOUNDARY_NAME " >> $GITHUB_ENV
156+ export AI_FOUNDRY_RESOURCE_ID =$(echo "$DEPLOY_OUTPUT" | jq -r '.AI_FOUNDRY_RESOURCE_ID .value')
157+ echo "AI_FOUNDRY_RESOURCE_ID=$AI_FOUNDRY_RESOURCE_ID " >> $GITHUB_ENV
165158 export SEARCH_SERVICE_NAME=$(echo "$DEPLOY_OUTPUT" | jq -r '.aI_SEARCH_SERVICE_NAME.value')
166159 echo "SEARCH_SERVICE_NAME=$SEARCH_SERVICE_NAME" >> $GITHUB_ENV
167160 export COSMOS_DB_ACCOUNT_NAME=$(echo "$DEPLOY_OUTPUT" | jq -r '.cosmosdB_ACCOUNT_NAME.value')
@@ -182,8 +175,6 @@ jobs:
182175 echo "CLIENT_NAME=$CLIENT_NAME" >> $GITHUB_ENV
183176 export RG_NAME=$(echo "$DEPLOY_OUTPUT" | jq -r '.resourcE_GROUP_NAME.value')
184177 echo "RG_NAME=$RG_NAME" >> $GITHUB_ENV
185- export RESOURCE_GROUP_NAME_FOUNDRY=$(echo "$DEPLOY_OUTPUT" | jq -r '.resourcE_GROUP_NAME_FOUNDRY.value')
186- echo "RESOURCE_GROUP_NAME_FOUNDRY=$RESOURCE_GROUP_NAME_FOUNDRY" >> $GITHUB_ENV
187178 WEBAPP_URL=$(echo $DEPLOY_OUTPUT | jq -r '.weB_APP_URL.value')
188179 echo "WEBAPP_URL=$WEBAPP_URL" >> $GITHUB_OUTPUT
189180 WEB_APP_NAME=$(echo $DEPLOY_OUTPUT | jq -r '.weB_APP_NAME.value')
@@ -195,9 +186,7 @@ jobs:
195186
196187 sleep 30
197188
198-
199-
200- - name : Deploy Infra and Import Sample Data
189+ - name : Deploy Infra and Import Sample Data
201190 run : |
202191 set -e
203192 az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
@@ -221,9 +210,8 @@ jobs:
221210 "${{ secrets.AZURE_CLIENT_ID }}" \
222211 "${{ env.RG_NAME }}" \
223212 "${{ env.SQL_SERVER_NAME }}" \
224- "${{ env.AI_FOUNDARY_NAME }}" \
225213 "${{ env.SEARCH_SERVICE_NAME }}" \
226- "${{ env.RESOURCE_GROUP_NAME_FOUNDRY }}"
214+ "${{ env.AI_FOUNDRY_RESOURCE_ID }}"
227215
228216
229217 user_roles_json='[
@@ -236,9 +224,7 @@ jobs:
236224 "${{ env.SQL_DATABASE }}" \
237225 "$user_roles_json" \
238226 "${{ secrets.AZURE_CLIENT_ID }}"
239-
240227 echo "=== Post-Deployment Script Completed Successfully ==="
241-
242228
243229 - name : Get AI Services name and store in variable
244230 if : always() && steps.check_create_rg.outcome == 'success'
@@ -262,7 +248,6 @@ jobs:
262248 run : |
263249 set -e
264250 echo "Listing all KeyVaults in the resource group ${{ env.RESOURCE_GROUP_NAME }}..."
265-
266251 # Get the list of KeyVaults in the specified resource group
267252 keyvaults=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --query "[?type=='Microsoft.KeyVault/vaults'].name" -o tsv)
268253
@@ -288,7 +273,6 @@ jobs:
288273 # Output the formatted array and save it to the job output
289274 echo "KEYVAULTS=$keyvault_array" >> $GITHUB_OUTPUT
290275 fi
291-
292276 - name : Set Deployment Status
293277 id : deployment_status
294278 if : always()
@@ -312,7 +296,7 @@ jobs:
312296 secrets : inherit
313297
314298 cleanup :
315- if : always()
299+ if : always()
316300 needs : [deploy, e2e-test]
317301 runs-on : ubuntu-latest
318302 env :
@@ -336,12 +320,10 @@ jobs:
336320 set -e
337321 echo "Checking if resource group exists..."
338322 echo "Resource group name: ${{ env.RESOURCE_GROUP_NAME }}"
339-
340323 if [ -z "${{ env.RESOURCE_GROUP_NAME }}" ]; then
341324 echo "Resource group name is empty. Skipping deletion."
342325 exit 0
343326 fi
344-
345327 rg_exists=$(az group exists --name "${{ env.RESOURCE_GROUP_NAME }}")
346328 if [ "$rg_exists" = "true" ]; then
347329 echo "Resource group exists. Cleaning..."
@@ -368,12 +350,9 @@ jobs:
368350
369351 # Remove the surrounding square brackets and quotes, if they exist
370352 stripped_keyvaults=$(echo "$KEYVAULTS" | sed 's/\[\|\]//g' | sed 's/"//g')
371-
372353 # Convert the comma-separated string into an array
373354 IFS=',' read -r -a resources_to_check <<< "$stripped_keyvaults"
374-
375355 echo "List of resources to check: ${resources_to_check[@]}"
376-
377356 # Check if resource group still exists before listing resources
378357 rg_exists=$(az group exists --name "${{ env.RESOURCE_GROUP_NAME }}")
379358 if [ "$rg_exists" = "false" ]; then
@@ -472,7 +451,6 @@ jobs:
472451
473452 # Remove the surrounding square brackets and quotes, if they exist
474453 stripped_keyvaults=$(echo "$KEYVAULTS" | sed 's/\[\|\]//g' | sed 's/"//g')
475-
476454 # Convert the comma-separated string into an array
477455 IFS=',' read -r -a keyvault_array <<< "$stripped_keyvaults"
478456
@@ -506,15 +484,13 @@ jobs:
506484 if : failure() || needs.deploy.result == 'failure' || needs.e2e-test.result == 'failure'
507485 run : |
508486 RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
509-
510487 # Construct the email body
511488 EMAIL_BODY=$(cat <<EOF
512489 {
513490 "body": "<p>Dear Team,</p><p>We would like to inform you that the Build-your-own-copilot-Solution-Accelerator(Client Advisior) Automation process has encountered an issue and has failed to complete successfully.</p><p><strong>Build URL:</strong> ${RUN_URL}<br> ${OUTPUT}</p><p>Please investigate the matter at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>"
514491 }
515492 EOF
516493 )
517-
518494 # Send the notification
519495 curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
520496 -H "Content-Type: application/json" \
0 commit comments