Skip to content

Commit 965c60b

Browse files
Merge remote-tracking branch 'origin/dev' into LogoutFunctionality_Akhileswar
2 parents 17eaacb + 7a5344e commit 965c60b

10 files changed

Lines changed: 380 additions & 56 deletions

File tree

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

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,16 @@ jobs:
3434
- name: Validate infra/ parameters
3535
id: validate_infra
3636
continue-on-error: true
37+
env:
38+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
3739
run: |
3840
set +e
39-
python infra/scripts/validate_bicep_params.py --dir infra --strict --no-color --json-output infra_results.json 2>&1 | tee infra_output.txt
41+
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
42+
python infra/scripts/validate_bicep_params.py --dir infra --strict --no-color \
43+
--json-output infra_results.json \
44+
--html-output email_body.html \
45+
--accelerator-name "${ACCELERATOR_NAME}" \
46+
--run-url "${RUN_URL}" 2>&1 | tee infra_output.txt
4047
EXIT_CODE=${PIPESTATUS[0]}
4148
set -e
4249
echo "## Infra Param Validation" >> "$GITHUB_STEP_SUMMARY"
@@ -61,24 +68,25 @@ jobs:
6168
name: bicep-validation-results
6269
path: |
6370
infra_results.json
71+
email_body.html
6472
retention-days: 30
6573

6674
- name: Send schedule notification on failure
6775
if: github.event_name == 'schedule' && steps.result.outputs.status == 'failure'
6876
env:
6977
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
70-
GITHUB_REPOSITORY: ${{ github.repository }}
71-
GITHUB_RUN_ID: ${{ github.run_id }}
7278
ACCELERATOR_NAME: ${{ env.accelerator_name }}
7379
run: |
74-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
75-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
80+
if [ -f email_body.html ]; then
81+
EMAIL_BODY=$(cat email_body.html)
82+
else
83+
EMAIL_BODY="<html><body><p>Bicep parameter validation failed but no HTML report was generated. Check workflow logs for details.</p></body></html>"
84+
fi
7685
7786
jq -n \
7887
--arg name "${ACCELERATOR_NAME}" \
79-
--arg infra "$INFRA_OUTPUT" \
80-
--arg url "$RUN_URL" \
81-
'{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>")}' \
88+
--arg body "$EMAIL_BODY" \
89+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: $body}' \
8290
| curl -X POST "${LOGICAPP_URL}" \
8391
-H "Content-Type: application/json" \
8492
-d @- || echo "Failed to send notification"
@@ -87,18 +95,18 @@ jobs:
8795
if: github.event_name == 'schedule' && steps.result.outputs.status == 'success'
8896
env:
8997
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
90-
GITHUB_REPOSITORY: ${{ github.repository }}
91-
GITHUB_RUN_ID: ${{ github.run_id }}
9298
ACCELERATOR_NAME: ${{ env.accelerator_name }}
9399
run: |
94-
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
95-
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
100+
if [ -f email_body.html ]; then
101+
EMAIL_BODY=$(cat email_body.html)
102+
else
103+
EMAIL_BODY="<html><body><p>Bicep parameter validation passed but no HTML report was generated (no parameter file pairs found).</p></body></html>"
104+
fi
96105
97106
jq -n \
98107
--arg name "${ACCELERATOR_NAME}" \
99-
--arg infra "$INFRA_OUTPUT" \
100-
--arg url "$RUN_URL" \
101-
'{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>")}' \
108+
--arg body "$EMAIL_BODY" \
109+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: $body}' \
102110
| curl -X POST "${LOGICAPP_URL}" \
103111
-H "Content-Type: application/json" \
104112
-d @- || echo "Failed to send notification"

docs/QuotaCheck.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ The final table lists regions with available quota. You can select any of these
7272
**To check quota for the deployment**
7373

7474
```sh
75-
curl -L -o quota_check_params.sh "https://raw.githubusercontent.com/microsoft/content-generation-solution-accelerator/main/content-gen/infra/scripts/quota_check_params.sh"
75+
curl -L -o quota_check_params.sh "https://raw.githubusercontent.com/microsoft/content-generation-solution-accelerator/main/infra/scripts/quota_check_params.sh"
7676
chmod +x quota_check_params.sh
7777
./quota_check_params.sh
7878
```

docs/create_new_app_registration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
![Redirect URL](images/AddRedirectURL.png)
2222

23-
6. Click on `+ Add a platform`.
23+
6. Click on `+ Add Redirect URI`.
2424

2525
![+ Add platform](images/AddPlatform.png)
2626

docs/images/AddDetails.png

-292 KB
Loading

docs/images/AddPlatform.png

-110 KB
Loading

docs/images/Web.png

-135 KB
Loading

0 commit comments

Comments
 (0)