Skip to content

Commit 282d67e

Browse files
Merge branch 'main' into demo
2 parents fff6c93 + 512e24c commit 282d67e

81 files changed

Lines changed: 10660 additions & 5246 deletions

File tree

Some content is hidden

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

.github/workflows/azure-dev-validation.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Azure Template Validation
22
on:
3-
workflow_dispatch:
3+
workflow_dispatch:
44

55
permissions:
66
contents: read
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
template_validation_job:
1313
runs-on: ubuntu-latest
14+
environment: production
1415
name: Template validation
1516

1617
steps:
@@ -21,13 +22,19 @@ jobs:
2122
# Step 2: Validate the Azure template using microsoft/template-validation-action
2223
- name: Validate Azure Template
2324
uses: microsoft/template-validation-action@v0.4.4
25+
with:
26+
validateAzd: true
27+
useDevContainer: false
28+
validateTests: false
2429
id: validation
2530
env:
2631
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
2732
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
2833
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
2934
AZURE_ENV_NAME: ${{ secrets.AZURE_ENV_NAME }}
3035
AZURE_LOCATION: ${{ secrets.AZURE_LOCATION }}
36+
AZURE_ENV_OPENAI_LOCATION: ${{ vars.AZURE_ENV_OPENAI_LOCATION || 'eastus2' }}
37+
AZURE_ENV_USE_CASE: ${{ vars.AZURE_ENV_USE_CASE || 'telecom' }}
3138
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3239
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
3340

.github/workflows/azure-dev.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Deploy to Azure
2+
3+
on:
4+
workflow_dispatch:
5+
# push:
6+
# branches:
7+
# - main
8+
9+
# Set up permissions for deploying with secretless Azure federated credentials
10+
# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
11+
permissions:
12+
id-token: write
13+
contents: read
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
environment: production
19+
env:
20+
AZURE_CLIENT_ID: ${{ vars.AZURE_CLIENT_ID }}
21+
AZURE_TENANT_ID: ${{ vars.AZURE_TENANT_ID }}
22+
AZURE_SUBSCRIPTION_ID: ${{ vars.AZURE_SUBSCRIPTION_ID }}
23+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
24+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
25+
AZURE_ENV_OPENAI_LOCATION: ${{ vars.AZURE_ENV_OPENAI_LOCATION || 'eastus2' }}
26+
AZURE_ENV_USE_CASE: ${{ vars.AZURE_ENV_USE_CASE || 'telecom' }}
27+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v6
31+
32+
- name: Install azd
33+
uses: Azure/setup-azd@v2.0.0
34+
35+
- name: Log in with Azure (Federated Credentials)
36+
run: |
37+
azd auth login `
38+
--client-id "$Env:AZURE_CLIENT_ID" `
39+
--federated-credential-provider "github" `
40+
--tenant-id "$Env:AZURE_TENANT_ID"
41+
shell: pwsh
42+
43+
- name: Provision Infrastructure
44+
run: azd provision --no-prompt
45+
env:
46+
AZD_INITIAL_ENVIRONMENT_CONFIG: ${{ secrets.AZD_INITIAL_ENVIRONMENT_CONFIG }}
47+
48+
- name: Deploy Application
49+
run: azd deploy --no-prompt

.github/workflows/bicep_deploy.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ on:
44
branches:
55
- ckm-v2
66

7-
7+
permissions:
8+
contents: read
9+
id-token: write
10+
811
jobs:
912
deploy:
1013
runs-on: ubuntu-latest
14+
environment: production
1115
steps:
1216
- name: Checkout Code
1317
uses: actions/checkout@v6
1418

19+
- name: Login to Azure
20+
uses: azure/login@v2
21+
with:
22+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
23+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
24+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
25+
1526
- name: Run Quota Check
1627
id: quota-check
1728
env:
18-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
19-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
20-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
2129
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
2230
GPT_MIN_CAPACITY: "30"
2331
AZURE_REGIONS: ${{ vars.AZURE_REGIONS }}
@@ -55,10 +63,6 @@ jobs:
5563
echo "Selected Region: $VALID_REGION"
5664
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
5765
58-
- name: Login to Azure
59-
run: |
60-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
61-
6266
- name: Install Bicep CLI
6367
run: az bicep install
6468

.github/workflows/deploy-KMGeneric.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
permissions:
1616
contents: read
1717
actions: read
18+
id-token: write
1819

1920
env:
2021
GPT_MIN_CAPACITY: 150
@@ -23,6 +24,7 @@ env:
2324
jobs:
2425
deploy:
2526
runs-on: ubuntu-latest
27+
environment: production
2628
outputs:
2729
RESOURCE_GROUP_NAME: ${{ steps.check_create_rg.outputs.RESOURCE_GROUP_NAME }}
2830
WEBAPP_URL: ${{ steps.get_output.outputs.WEBAPP_URL }}
@@ -33,14 +35,15 @@ jobs:
3335
uses: actions/checkout@v6
3436

3537
- name: Login to Azure
36-
run: |
37-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
38+
uses: azure/login@v2
39+
with:
40+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
41+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
42+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
43+
3844
- name: Run Quota Check
3945
id: quota-check
4046
env:
41-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
42-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
43-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
4447
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4548
GPT_MIN_CAPACITY: ${{ env.GPT_MIN_CAPACITY }}
4649
TEXT_EMBEDDING_MIN_CAPACITY: ${{ env.TEXT_EMBEDDING_MIN_CAPACITY }}
@@ -115,7 +118,7 @@ jobs:
115118
echo "Generated SOLUTION_PREFIX: ${UNIQUE_SOLUTION_PREFIX}"
116119
- name: Determine Tag Name Based on Branch
117120
id: determine_tag
118-
run: echo "tagname=${{ github.ref_name == 'main' && 'latest_waf' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || 'latest_waf' }}" >> $GITHUB_OUTPUT
121+
run: echo "tagname=${{ github.ref_name == 'main' && 'latest_afv2' || github.ref_name == 'dev' && 'dev' || github.ref_name == 'demo' && 'demo' || github.ref_name == 'dependabotchanges' && 'dependabotchanges' || 'latest_afv2' }}" >> $GITHUB_OUTPUT
119122
- name: Deploy Bicep Template
120123
id: deploy
121124
run: |
@@ -191,13 +194,17 @@ jobs:
191194
if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
192195
needs: [deploy, e2e-test]
193196
runs-on: ubuntu-latest
197+
environment: production
194198
env:
195199
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
196200
steps:
197201
- name: Login to Azure
198-
run: |
199-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
200-
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
202+
uses: azure/login@v2
203+
with:
204+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
205+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
206+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
207+
201208
- name: Extract AI Services and Key Vault Names
202209
if: always()
203210
run: |

.github/workflows/deploy-orchestrator.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
secrets: inherit
101101

102102
e2e-test:
103-
if: false # E2E testing disabled
103+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APP_URL != '') || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests && inputs.run_e2e_tests != 'None'))"
104104
needs: [docker-build, deploy]
105105
uses: ./.github/workflows/job-test-automation.yml
106106
with:
@@ -110,9 +110,25 @@ jobs:
110110
AZURE_ENV_USE_CASE: ${{ inputs.azure_env_use_case }}
111111
secrets: inherit
112112

113+
cleanup-deployment:
114+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
115+
needs: [docker-build, deploy, e2e-test]
116+
uses: ./.github/workflows/job-cleanup-resources.yml
117+
with:
118+
runner_os: ${{ inputs.runner_os }}
119+
trigger_type: ${{ inputs.trigger_type }}
120+
cleanup_resources: ${{ inputs.cleanup_resources }}
121+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
122+
resource_group_name: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
123+
azure_location: ${{ needs.deploy.outputs.AZURE_LOCATION }}
124+
azure_env_openai_location: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
125+
env_name: ${{ needs.deploy.outputs.ENV_NAME }}
126+
image_tag: ${{ needs.deploy.outputs.IMAGE_TAG }}
127+
secrets: inherit
128+
113129
send-notification:
114130
if: "!cancelled()"
115-
needs: [docker-build, deploy, e2e-test]
131+
needs: [docker-build, deploy, e2e-test, cleanup-deployment]
116132
uses: ./.github/workflows/job-send-notifications.yml
117133
with:
118134
trigger_type: ${{ inputs.trigger_type }}
@@ -127,20 +143,5 @@ jobs:
127143
quota_failed: ${{ needs.deploy.outputs.QUOTA_FAILED }}
128144
test_success: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
129145
test_report_url: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
130-
secrets: inherit
131-
132-
cleanup-deployment:
133-
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
134-
needs: [docker-build, deploy, e2e-test]
135-
uses: ./.github/workflows/job-cleanup-resources.yml
136-
with:
137-
runner_os: ${{ inputs.runner_os }}
138-
trigger_type: ${{ inputs.trigger_type }}
139-
cleanup_resources: ${{ inputs.cleanup_resources }}
140-
existing_webapp_url: ${{ inputs.existing_webapp_url }}
141-
resource_group_name: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
142-
azure_location: ${{ needs.deploy.outputs.AZURE_LOCATION }}
143-
azure_env_openai_location: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
144-
env_name: ${{ needs.deploy.outputs.ENV_NAME }}
145-
image_tag: ${{ needs.deploy.outputs.IMAGE_TAG }}
146+
cleanup_result: ${{ needs.cleanup-deployment.result }}
146147
secrets: inherit
Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy-Test-Cleanup Linux
1+
name: Deploy-Test-Cleanup (v2)
22
on:
33
pull_request:
44
branches:
@@ -21,6 +21,15 @@ on:
2121
- '.github/workflows/deploy-*.yml'
2222
workflow_dispatch:
2323
inputs:
24+
runner_os:
25+
description: 'Deployment Environment'
26+
required: false
27+
type: choice
28+
options:
29+
- 'codespace'
30+
- 'Local'
31+
default: 'codespace'
32+
2433
azure_location:
2534
description: 'Azure Location For Deployment'
2635
required: false
@@ -93,11 +102,11 @@ on:
93102
required: false
94103
default: ''
95104
type: string
96-
97105

98106
permissions:
99107
contents: read
100108
actions: read
109+
id-token: write
101110

102111
jobs:
103112
validate-inputs:
@@ -115,6 +124,7 @@ jobs:
115124
azure_existing_ai_project_resource_id: ${{ steps.validate.outputs.azure_existing_ai_project_resource_id }}
116125
existing_webapp_url: ${{ steps.validate.outputs.existing_webapp_url }}
117126
azure_env_use_case: ${{ steps.validate.outputs.azure_env_use_case }}
127+
runner_os: ${{ steps.validate.outputs.runner_os }}
118128

119129
steps:
120130
- name: Validate Workflow Input Parameters
@@ -132,10 +142,25 @@ jobs:
132142
INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ github.event.inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
133143
INPUT_EXISTING_WEBAPP_URL: ${{ github.event.inputs.existing_webapp_url }}
134144
INPUT_AZURE_ENV_USE_CASE: ${{ github.event.inputs.AZURE_ENV_USE_CASE }}
145+
INPUT_RUNNER_OS: ${{ github.event.inputs.runner_os }}
135146

136147
run: |
137148
echo "🔍 Validating workflow input parameters..."
138149
VALIDATION_FAILED=false
150+
151+
# Resolve runner_os from Deployment Environment selection
152+
DEPLOY_ENV="${INPUT_RUNNER_OS:-codespace}"
153+
if [[ "$DEPLOY_ENV" == "codespace" ]]; then
154+
RUNNER_OS="ubuntu-latest"
155+
echo "✅ Deployment Environment: 'codespace' → runner: ubuntu-latest"
156+
elif [[ "$DEPLOY_ENV" == "Local" ]]; then
157+
RUNNER_OS="windows-latest"
158+
echo "✅ Deployment Environment: 'Local' → runner: windows-latest"
159+
else
160+
echo "❌ ERROR: Deployment Environment must be 'codespace' or 'Local', got: '$DEPLOY_ENV'"
161+
VALIDATION_FAILED=true
162+
RUNNER_OS="ubuntu-latest"
163+
fi
139164
140165
# Validate azure_location (Azure region format)
141166
LOCATION="${INPUT_AZURE_LOCATION:-australiaeast}"
@@ -279,14 +304,15 @@ jobs:
279304
echo "azure_existing_ai_project_resource_id=$INPUT_AZURE_EXISTING_AI_PROJECT_RESOURCE_ID" >> $GITHUB_OUTPUT
280305
echo "existing_webapp_url=$INPUT_EXISTING_WEBAPP_URL" >> $GITHUB_OUTPUT
281306
echo "azure_env_use_case=$USE_CASE" >> $GITHUB_OUTPUT
307+
echo "runner_os=$RUNNER_OS" >> $GITHUB_OUTPUT
282308
283309
284310
Run:
285311
needs: validate-inputs
286312
if: needs.validate-inputs.outputs.validation_passed == 'true'
287313
uses: ./.github/workflows/deploy-orchestrator.yml
288314
with:
289-
runner_os: ubuntu-latest
315+
runner_os: ${{ needs.validate-inputs.outputs.runner_os || 'ubuntu-latest' }}
290316
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
291317
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
292318
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
@@ -299,4 +325,5 @@ jobs:
299325
existing_webapp_url: ${{ needs.validate-inputs.outputs.existing_webapp_url || '' }}
300326
azure_env_use_case: ${{ needs.validate-inputs.outputs.azure_env_use_case || 'telecom' }}
301327
trigger_type: ${{ github.event_name }}
302-
secrets: inherit
328+
secrets: inherit
329+

0 commit comments

Comments
 (0)