Skip to content

Commit aa0401d

Browse files
Format changes
1 parent 4be80cb commit aa0401d

4 files changed

Lines changed: 297 additions & 27 deletions

File tree

.github/workflows/validate-bicep-params.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,16 @@ jobs:
3333
- name: Validate infra/ parameters
3434
id: validate_infra
3535
continue-on-error: true
36+
env:
37+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
3638
run: |
3739
set +e
38-
python infra/scripts/validate_bicep_params.py --dir infra --strict --no-color --json-output infra_results.json 2>&1 | tee infra_output.txt
40+
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
41+
python infra/scripts/validate_bicep_params.py --dir infra --strict --no-color \
42+
--json-output infra_results.json \
43+
--html-output email_body.html \
44+
--accelerator-name "${ACCELERATOR_NAME}" \
45+
--run-url "${RUN_URL}" 2>&1 | tee infra_output.txt
3946
EXIT_CODE=${PIPESTATUS[0]}
4047
set -e
4148
echo "## Infra Param Validation" >> "$GITHUB_STEP_SUMMARY"
@@ -60,44 +67,37 @@ jobs:
6067
name: bicep-validation-results
6168
path: |
6269
infra_results.json
70+
email_body.html
6371
retention-days: 30
6472

6573
- name: Send schedule notification on failure
66-
if: github.event_name == 'schedule' && steps.result.outputs.status == 'failure'
74+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && steps.result.outputs.status == 'failure'
6775
env:
6876
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
69-
GITHUB_REPOSITORY: ${{ github.repository }}
70-
GITHUB_RUN_ID: ${{ github.run_id }}
7177
ACCELERATOR_NAME: ${{ env.accelerator_name }}
7278
run: |
73-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
74-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
79+
EMAIL_BODY=$(cat email_body.html)
7580
7681
jq -n \
7782
--arg name "${ACCELERATOR_NAME}" \
78-
--arg infra "$INFRA_OUTPUT" \
79-
--arg url "$RUN_URL" \
80-
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has detected parameter mapping errors.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Please fix the parameter mapping issues at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>")}' \
83+
--arg body "$EMAIL_BODY" \
84+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: $body}' \
8185
| curl -X POST "${LOGICAPP_URL}" \
8286
-H "Content-Type: application/json" \
8387
-d @- || echo "Failed to send notification"
8488
8589
- name: Send schedule notification on success
86-
if: github.event_name == 'schedule' && steps.result.outputs.status == 'success'
90+
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && steps.result.outputs.status == 'success'
8791
env:
8892
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
89-
GITHUB_REPOSITORY: ${{ github.repository }}
90-
GITHUB_RUN_ID: ${{ github.run_id }}
9193
ACCELERATOR_NAME: ${{ env.accelerator_name }}
9294
run: |
93-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
94-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
95+
EMAIL_BODY=$(cat email_body.html)
9596
9697
jq -n \
9798
--arg name "${ACCELERATOR_NAME}" \
98-
--arg infra "$INFRA_OUTPUT" \
99-
--arg url "$RUN_URL" \
100-
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has completed successfully. All parameter mappings are valid.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Best regards,<br>Your Automation Team</p>")}' \
99+
--arg body "$EMAIL_BODY" \
100+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: $body}' \
101101
| curl -X POST "${LOGICAPP_URL}" \
102102
-H "Content-Type: application/json" \
103103
-d @- || echo "Failed to send notification"

infra/main.parameters.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"value": "${AZURE_ENV_NAME}"
77
},
88
"location": {
9-
"value": "${AZURE_LOCATION}"
9+
"value": "${AZURE_LOCATION2323}"
1010
},
1111
"contentUnderstandingLocation": {
1212
"value": "${AZURE_ENV_CU_LOCATION}"
@@ -17,13 +17,13 @@
1717
"deploymentType": {
1818
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
1919
},
20-
"gptModelName": {
20+
"gptModelName232": {
2121
"value": "${AZURE_ENV_GPT_MODEL_NAME}"
2222
},
23-
"gptModelVersion": {
23+
"gptModelVersion232": {
2424
"value": "${AZURE_ENV_GPT_MODEL_VERSION}"
2525
},
26-
"gptDeploymentCapacity": {
26+
"gptDeploymentCapacity23": {
2727
"value": "${AZURE_ENV_GPT_MODEL_CAPACITY}"
2828
},
2929
"existingLogAnalyticsWorkspaceId": {

infra/main.waf.parameters.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@
66
"value": "${AZURE_ENV_NAME}"
77
},
88
"location": {
9-
"value": "${AZURE_LOCATION}"
9+
"value": "${AZURE_LOCATION2342}"
1010
},
11-
"contentUnderstandingLocation": {
11+
"contentUnderstandingL24ocation": {
1212
"value": "${AZURE_ENV_CU_LOCATION}"
1313
},
14-
"azureAiServiceLocation": {
14+
"azureAiServ324iceLocation": {
1515
"value": "${AZURE_ENV_AI_SERVICE_LOCATION}"
1616
},
17-
"deploymentType": {
17+
"deployme234ntType": {
1818
"value": "${AZURE_ENV_MODEL_DEPLOYMENT_TYPE}"
1919
},
20-
"gptModelName": {
20+
"gptModelN234ame": {
2121
"value": "${AZURE_ENV_GPT_MODEL_NAME}"
2222
},
23-
"gptModelVersion": {
23+
"gptModelV324ersion": {
2424
"value": "${AZURE_ENV_GPT_MODEL_VERSION}"
2525
},
2626
"gptDeploymentCapacity": {

0 commit comments

Comments
 (0)