Skip to content

Commit 4c353bf

Browse files
Merge branch 'dev' into v2
2 parents fddcf5c + 0e14fd0 commit 4c353bf

47 files changed

Lines changed: 51126 additions & 5194 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.12-bullseye
2+
3+
# Remove Yarn repository to avoid GPG key expiration issue
4+
RUN rm -f /etc/apt/sources.list.d/yarn.list

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "DevContainer for Container Migration Solution Accelerator",
3-
"image": "mcr.microsoft.com/devcontainers/python:3.12-bullseye",
3+
"build": {
4+
"dockerfile": "Dockerfile"
5+
},
46
"features": {
57
"ghcr.io/dhoeric/features/hadolint:1": {},
68
"ghcr.io/jsburckhardt/devcontainer-features/uv:1": {},
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: AZD Template Validation
2+
on:
3+
4+
schedule:
5+
- cron: '30 1 * * 4' # Every Thursday at 7:00 AM IST (1:30 AM UTC)
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
pull-requests: write
12+
13+
jobs:
14+
template_validation:
15+
runs-on: ubuntu-latest
16+
name: azd template validation
17+
environment: production
18+
env:
19+
GH_TOKEN: ${{ github.token }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set timestamp
24+
run: echo "HHMM=$(date -u +'%H%M')" >> $GITHUB_ENV
25+
26+
- uses: microsoft/template-validation-action@v0.4.3
27+
with:
28+
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
29+
validateTests: ${{ vars.TEMPLATE_VALIDATE_TESTS }}
30+
useDevContainer: ${{ vars.TEMPLATE_USE_DEV_CONTAINER }}
31+
id: validation
32+
env:
33+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
34+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
35+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
36+
AZURE_ENV_NAME: azd-${{ vars.AZURE_ENV_NAME }}-${{ env.HHMM }}
37+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
38+
AZURE_AI_SERVICE_LOCATION: ${{ vars.AZURE_LOCATION }}
39+
AZURE_AI_MODEL_CAPACITY: 1 # keep low to avoid potential quota issues
40+
41+
- name: print result
42+
run: cat ${{ steps.validation.outputs.resultFile }}

.github/workflows/azure-dev.yml

Lines changed: 44 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,56 @@
1-
name: AZD Template Validation
1+
name: Azure Dev Deploy
2+
23
on:
34
workflow_dispatch:
45

56
permissions:
67
contents: read
78
id-token: write
8-
pull-requests: write
99

1010
jobs:
11-
template_validation:
11+
deploy:
1212
runs-on: ubuntu-latest
13-
name: azd template validation
14-
environment: azd-template-gallery
13+
environment: production
14+
env:
15+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
16+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
17+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
18+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
19+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
1520
steps:
16-
- uses: actions/checkout@v4
21+
- name: Checkout Code
22+
uses: actions/checkout@v4
23+
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+
30+
- name: Install azd
31+
uses: Azure/setup-azd@v2
1732

18-
- uses: microsoft/template-validation-action@v0.4.3
33+
- name: Login to Azure
34+
uses: azure/login@v2
1935
with:
20-
validateAzd: ${{ vars.AZD_VALIDATE }}
21-
useDevContainer: ${{ vars.AZD_USE_DEV_CONTAINER }}
22-
id: validation
23-
env:
24-
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
25-
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
26-
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
27-
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
28-
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
29-
AZURE_AI_MODEL_CAPACITY: 1 # keep low to avoid potential quota issues
30-
GITHUB_TOKEN: ${{ secrets.AZD_GITHUB_TOKEN }}
31-
32-
- name: print result
33-
run: cat ${{ steps.validation.outputs.resultFile }}
36+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
37+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
38+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
39+
40+
- name: Login to AZD
41+
shell: bash
42+
run: |
43+
azd auth login \
44+
--client-id "$AZURE_CLIENT_ID" \
45+
--federated-credential-provider "github" \
46+
--tenant-id "$AZURE_TENANT_ID"
47+
48+
- name: Provision and Deploy
49+
shell: bash
50+
run: |
51+
if ! azd env select "$AZURE_ENV_NAME"; then
52+
azd env new "$AZURE_ENV_NAME" --subscription "$AZURE_SUBSCRIPTION_ID" --location "$AZURE_LOCATION" --no-prompt
53+
fi
54+
azd config set defaults.subscription "$AZURE_SUBSCRIPTION_ID"
55+
azd env set AZURE_AI_SERVICE_LOCATION="$AZURE_LOCATION"
56+
azd up --no-prompt

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Validate Deployment
33
permissions:
44
contents: read
55
actions: read
6+
id-token: write
67

78
on:
89
push:
@@ -34,6 +35,7 @@ env:
3435
jobs:
3536
deploy:
3637
runs-on: ubuntu-latest
38+
environment: production
3739
outputs:
3840
RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
3941
DEPLOYMENT_SUCCESS: ${{ steps.deployment_status.outputs.SUCCESS }}
@@ -42,14 +44,14 @@ jobs:
4244
uses: actions/checkout@v4
4345

4446
- name: Login to Azure
45-
run: |
46-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
47+
uses: azure/login@v2
48+
with:
49+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
50+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
51+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4752
- name: Run Quota Check
4853
id: quota-check
4954
env:
50-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
51-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
52-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
5355
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5456
AZURE_REGIONS: ${{ vars.AZURE_REGIONS }}
5557
GPT_MIN_CAPACITY: ${{ env.GPT_MIN_CAPACITY }}
@@ -169,13 +171,16 @@ jobs:
169171
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
170172
needs: [deploy]
171173
runs-on: ubuntu-latest
174+
environment: production
172175
env:
173176
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
174177
steps:
175178
- name: Login to Azure
176-
run: |
177-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
178-
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
179+
uses: azure/login@v2
180+
with:
181+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
182+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
183+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
179184
- name: Extract AI Services and Key Vault Names
180185
if: always()
181186
run: |

.github/workflows/deploy-linux.yml

Lines changed: 0 additions & 93 deletions
This file was deleted.

.github/workflows/deploy-orchestrator.yml

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
name: Deployment orchestrator
22

3-
permissions:
4-
contents: read
5-
actions: read
6-
73
on:
84
workflow_call:
95
inputs:
@@ -73,7 +69,7 @@ jobs:
7369
secrets: inherit
7470

7571
deploy:
76-
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
72+
if: "!cancelled() && (needs.docker-build.result == 'success' || needs.docker-build.result == 'skipped') && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
7773
needs: docker-build
7874
uses: ./.github/workflows/job-deploy.yml
7975
with:
@@ -91,21 +87,6 @@ jobs:
9187
cleanup_resources: ${{ inputs.cleanup_resources }}
9288
secrets: inherit
9389

94-
send-notification:
95-
if: "!cancelled()"
96-
needs: [docker-build, deploy]
97-
uses: ./.github/workflows/job-send-notification.yml
98-
with:
99-
trigger_type: ${{ inputs.trigger_type }}
100-
waf_enabled: ${{ inputs.waf_enabled }}
101-
EXP: ${{ inputs.EXP }}
102-
existing_webapp_url: ${{ inputs.existing_webapp_url }}
103-
deploy_result: ${{ needs.deploy.result }}
104-
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
105-
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
106-
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
107-
secrets: inherit
108-
10990
cleanup-deployment:
11091
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
11192
needs: [docker-build, deploy]
@@ -121,3 +102,19 @@ jobs:
121102
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
122103
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
123104
secrets: inherit
105+
106+
send-notification:
107+
if: "!cancelled()"
108+
needs: [docker-build, deploy, cleanup-deployment]
109+
uses: ./.github/workflows/job-send-notification.yml
110+
with:
111+
trigger_type: ${{ inputs.trigger_type }}
112+
waf_enabled: ${{ inputs.waf_enabled }}
113+
EXP: ${{ inputs.EXP }}
114+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
115+
deploy_result: ${{ needs.deploy.result }}
116+
cleanup_result: ${{ needs.cleanup-deployment.result }}
117+
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
118+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
119+
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
120+
secrets: inherit

0 commit comments

Comments
 (0)