Skip to content

Commit 01762f2

Browse files
Merge pull request #181 from microsoft/dev
chore: Dev to Main merge
2 parents c4b370f + 2825301 commit 01762f2

16 files changed

Lines changed: 820 additions & 352 deletions

.github/workflows/azd-template-validation.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: AZD Template Validation
22
on:
3+
34
schedule:
45
- cron: '30 1 * * 4' # Every Thursday at 7:00 AM IST (1:30 AM UTC)
56
workflow_dispatch:
@@ -14,9 +15,14 @@ jobs:
1415
runs-on: ubuntu-latest
1516
name: azd template validation
1617
environment: production
18+
env:
19+
GH_TOKEN: ${{ github.token }}
1720
steps:
1821
- uses: actions/checkout@v4
1922

23+
- name: Set timestamp
24+
run: echo "HHMM=$(date -u +'%H%M')" >> $GITHUB_ENV
25+
2026
- uses: microsoft/template-validation-action@v0.4.3
2127
with:
2228
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
@@ -27,11 +33,10 @@ jobs:
2733
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2834
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
2935
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
30-
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
36+
AZURE_ENV_NAME: azd-${{ vars.AZURE_ENV_NAME }}-${{ env.HHMM }}
3137
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
3238
AZURE_AI_SERVICE_LOCATION: ${{ vars.AZURE_LOCATION }}
3339
AZURE_AI_MODEL_CAPACITY: 1 # keep low to avoid potential quota issues
34-
GITHUB_TOKEN: ${{ secrets.AZD_GITHUB_TOKEN }}
3540

3641
- name: print result
3742
run: cat ${{ steps.validation.outputs.resultFile }}

.github/workflows/azure-dev.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ jobs:
1515
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
1616
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
1717
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
18-
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
1918
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
2019
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
2120
steps:
2221
- name: Checkout Code
2322
uses: actions/checkout@v4
2423

24+
- name: Set timestamp and env name
25+
shell: bash
26+
run: |
27+
HHMM=$(date -u +'%H%M')
28+
echo "AZURE_ENV_NAME=azd-${{ vars.AZURE_ENV_NAME }}-${HHMM}" >> $GITHUB_ENV
29+
2530
- name: Install azd
2631
uses: Azure/setup-azd@v2
2732

.github/workflows/deploy-v2.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,25 @@ on:
1111
- main
1212
- dev
1313
- demo
14+
paths:
15+
- 'src/**'
16+
- 'infra/**'
17+
- 'azure*.yaml'
18+
- 'scripts/**'
19+
- '.github/workflows/deploy-v2.yml'
20+
- '.github/workflows/deploy-orchestrator.yml'
21+
- '.github/workflows/job-*.yml'
1422
pull_request:
1523
branches:
1624
- dev
25+
paths:
26+
- 'src/**'
27+
- 'infra/**'
28+
- 'azure*.yaml'
29+
- 'scripts/**'
30+
- '.github/workflows/deploy-v2.yml'
31+
- '.github/workflows/deploy-orchestrator.yml'
32+
- '.github/workflows/job-*.yml'
1733
schedule:
1834
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
1935
workflow_dispatch:
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Validate Bicep Parameters
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
schedule:
8+
- cron: '30 6 * * 3' # Wednesday 12:00 PM IST (6:30 AM UTC)
9+
pull_request:
10+
branches:
11+
- main
12+
- dev
13+
paths:
14+
- 'infra/**/*.bicep'
15+
- 'infra/**/*.parameters.json'
16+
- 'scripts/validate_bicep_params.py'
17+
workflow_dispatch:
18+
19+
env:
20+
accelerator_name: "Container Migration"
21+
22+
jobs:
23+
validate:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.11'
33+
34+
- name: Validate infra/ parameters
35+
id: validate_infra
36+
continue-on-error: true
37+
run: |
38+
set +e
39+
python scripts/validate_bicep_params.py --dir infra --strict --no-color --json-output infra_results.json 2>&1 | tee infra_output.txt
40+
EXIT_CODE=${PIPESTATUS[0]}
41+
set -e
42+
echo "## Infra Param Validation" >> "$GITHUB_STEP_SUMMARY"
43+
echo '```' >> "$GITHUB_STEP_SUMMARY"
44+
cat infra_output.txt >> "$GITHUB_STEP_SUMMARY"
45+
echo '```' >> "$GITHUB_STEP_SUMMARY"
46+
exit $EXIT_CODE
47+
48+
- name: Set overall result
49+
id: result
50+
run: |
51+
if [[ "${{ steps.validate_infra.outcome }}" == "failure" ]]; then
52+
echo "status=failure" >> "$GITHUB_OUTPUT"
53+
else
54+
echo "status=success" >> "$GITHUB_OUTPUT"
55+
fi
56+
57+
- name: Upload validation results
58+
if: always()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: bicep-validation-results
62+
path: |
63+
infra_results.json
64+
retention-days: 30
65+
66+
- name: Send schedule notification on failure
67+
if: github.event_name == 'schedule' && steps.result.outputs.status == 'failure'
68+
env:
69+
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
70+
GITHUB_REPOSITORY: ${{ github.repository }}
71+
GITHUB_RUN_ID: ${{ github.run_id }}
72+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
73+
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)
76+
77+
jq -n \
78+
--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>")}' \
82+
| curl -X POST "${LOGICAPP_URL}" \
83+
-H "Content-Type: application/json" \
84+
-d @- || echo "Failed to send notification"
85+
86+
- name: Send schedule notification on success
87+
if: github.event_name == 'schedule' && steps.result.outputs.status == 'success'
88+
env:
89+
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
90+
GITHUB_REPOSITORY: ${{ github.repository }}
91+
GITHUB_RUN_ID: ${{ github.run_id }}
92+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
93+
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)
96+
97+
jq -n \
98+
--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>")}' \
102+
| curl -X POST "${LOGICAPP_URL}" \
103+
-H "Content-Type: application/json" \
104+
-d @- || echo "Failed to send notification"
105+
106+
- name: Fail if errors found
107+
if: steps.result.outputs.status == 'failure'
108+
run: exit 1

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ The Container Migration Solution Accelerator supports development and deployment
109109

110110
![Deployment Architecture](docs/images/readme/deployment-architecture.png)
111111

112+
> **Note**: Some tenants may have additional security restrictions that run periodically and could impact the application (e.g., blocking public network access). If you experience issues or the application stops working, check if these restrictions are the cause. In such cases, consider deploying the WAF-supported version to ensure compliance. To configure, [Click here](./docs/DeploymentGuide.md#31-choose-deployment-type-optional).
113+
112114
> ⚠️ **Important: Check Azure OpenAI o3 Model Availability**
113115
> To ensure o3 model access is available in your subscription, please check [Azure OpenAI model availability](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#o3-models) before you deploy the solution.
114116

azure.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66

77
requiredVersions:
88
azd: '>=1.18.2 != 1.23.9'
9+
bicep: '>= 0.33.0'
910

1011
hooks:
1112
postdeploy:

docs/DeploymentGuide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ This guide walks you through deploying the Container Migration Solution Accelera
66

77
🆘 **Need Help?** If you encounter any issues during deployment, check our [Troubleshooting Guide](./TroubleShootingSteps.md) for solutions to common problems.
88

9+
> **Note**: Some tenants may have additional security restrictions that run periodically and could impact the application (e.g., blocking public network access). If you experience issues or the application stops working, check if these restrictions are the cause. In such cases, consider deploying the WAF-supported version to ensure compliance. To configure, [Click here](#31-choose-deployment-type-optional).
10+
911
## Step 1: Prerequisites & Setup
1012

1113
### 1.1 Azure Account Requirements

infra/main.parameters.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"location": {
99
"value": "${AZURE_LOCATION}"
1010
},
11-
"secondaryLocation": {
12-
"value": "${AZURE_SECONDARY_LOCATION}"
13-
},
1411
"containerRegistryHost": {
1512
"value": "${AZURE_CONTAINER_REGISTRY_HOST}"
1613
},

infra/main.waf.parameters.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"location": {
99
"value": "${AZURE_LOCATION}"
1010
},
11-
"secondaryLocation": {
12-
"value": "${AZURE_SECONDARY_LOCATION}"
13-
},
1411
"containerRegistryHost": {
1512
"value": "${AZURE_CONTAINER_REGISTRY_HOST}"
1613
},

0 commit comments

Comments
 (0)