Skip to content

Commit 851f0a2

Browse files
Merge pull request #560 from microsoft/main
fix: downmerge from main to dev
2 parents 54983ec + 98c605e commit 851f0a2

22 files changed

Lines changed: 2192 additions & 705 deletions

.github/workflows/CI.yml

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@ on:
1515
- 'tests/**'
1616
schedule:
1717
- cron: "0 10,22 * * *" # Runs at 10:00 AM and 10:00 PM GMT
18-
18+
permissions:
19+
id-token: write
20+
contents: read
21+
actions: read
1922
env:
2023
GPT_CAPACITY: 150
2124
TEXT_EMBEDDING_CAPACITY: 200
2225

2326
jobs:
2427
deploy:
2528
runs-on: ubuntu-latest
29+
environment: production
2630
outputs:
2731
RESOURCE_GROUP_NAME: ${{ steps.get_webapp_url.outputs.RESOURCE_GROUP_NAME }}
2832
KUBERNETES_RESOURCE_GROUP_NAME: ${{ steps.get_webapp_url.outputs.KUBERNETES_RESOURCE_GROUP_NAME }}
@@ -35,12 +39,6 @@ jobs:
3539
- name: Checkout Code
3640
uses: actions/checkout@v5 # Checks out your repository
3741

38-
- name: Install Azure CLI
39-
shell: bash
40-
run: |
41-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
42-
az --version # Verify installation
43-
4442
- name: Install Kubernetes CLI (kubectl)
4543
shell: bash
4644
run: |
@@ -82,6 +80,14 @@ jobs:
8280
with:
8381
driver: docker
8482

83+
- name: Login to Azure
84+
uses: azure/login@v2
85+
with:
86+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
87+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
88+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
89+
enable-AzPSSession: true
90+
8591
- name: Run Quota Check
8692
id: quota-check
8793
shell: pwsh
@@ -109,9 +115,6 @@ jobs:
109115
}
110116
env:
111117
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
112-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
113-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
114-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
115118
GPT_MIN_CAPACITY: ${{ env.GPT_CAPACITY }}
116119
TEXT_EMBEDDING_MIN_CAPACITY: ${{ env.TEXT_EMBEDDING_CAPACITY }}
117120
AZURE_REGIONS: "${{ vars.AZURE_REGIONS }}"
@@ -144,10 +147,8 @@ jobs:
144147
- name: Install Bicep CLI
145148
run: az bicep install
146149

147-
- name: Install Azure Developer CLI
148-
run: |
149-
curl -fsSL https://aka.ms/install-azd.sh | bash
150-
shell: bash
150+
- name: Install azd
151+
uses: Azure/setup-azd@v2
151152

152153
- name: Set Deployment Region
153154
run: |
@@ -164,11 +165,6 @@ jobs:
164165
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
165166
echo "Generated RESOURCE_GROUP_NAME: ${UNIQUE_RG_NAME}"
166167
167-
- name: Login to Azure
168-
run: |
169-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
170-
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
171-
172168
- name: Check and Create Resource Group
173169
id: check_create_rg
174170
run: |
@@ -223,7 +219,7 @@ jobs:
223219
enableRedundancy=false \
224220
enableScalability=false \
225221
createdBy="Pipeline" \
226-
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
222+
tags="{'Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
227223
228224
- name: Get Deployment Output and extract Values
229225
id: get_output
@@ -258,11 +254,8 @@ jobs:
258254
Write-Host "Resource Group Name is ${{ env.RESOURCE_GROUP_NAME }}"
259255
Write-Host "Kubernetes resource group is ${{ env.AZURE_AKS_NAME }}"
260256
env:
261-
# From GitHub secrets (for login)
257+
# From GitHub secrets
262258
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
263-
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
264-
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
265-
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
266259

267260
# From deployment outputs step (these come from $GITHUB_ENV)
268261
RESOURCE_GROUP_NAME: ${{ env.RESOURCE_GROUP_NAME }}
@@ -298,10 +291,9 @@ jobs:
298291
if az account show &> /dev/null; then
299292
echo "Azure CLI is authenticated."
300293
else
301-
echo "Azure CLI is not authenticated. Logging in..."
302-
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
294+
echo "Azure CLI is not authenticated. Please check the OIDC login step."
295+
exit 1
303296
fi
304-
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
305297
306298
# Get the Web App URL and save it to GITHUB_OUTPUT
307299
echo "Retrieving Web App URL..."
@@ -356,6 +348,7 @@ jobs:
356348
357349
- name: Run Post Deployment Script
358350
shell: pwsh
351+
continue-on-error: true
359352
run: |
360353
Write-Host "Running post deployment script to upload files..."
361354
cd Deployment
@@ -398,6 +391,7 @@ jobs:
398391
if: always()
399392
needs: [deploy, e2e-test]
400393
runs-on: ubuntu-latest
394+
environment: production
401395
env:
402396
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
403397
KUBERNETES_RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.KUBERNETES_RESOURCE_GROUP_NAME }}
@@ -406,17 +400,12 @@ jobs:
406400
VALID_REGION: ${{ needs.deploy.outputs.VALID_REGION }}
407401

408402
steps:
409-
- name: Install Azure CLI
410-
shell: bash
411-
run: |
412-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
413-
az --version # Verify installation
414-
415403
- name: Login to Azure
416-
shell: bash
417-
run: |
418-
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
419-
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
404+
uses: azure/login@v2
405+
with:
406+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
407+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
408+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
420409

421410
- name: Delete Resource Groups
422411
if: env.RESOURCE_GROUP_NAME != ''

.github/workflows/codeql.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,13 @@ on:
88
- 'App/frontend-app/**'
99
- 'App/kernel-memory/**'
1010
- '.github/workflows/codeql.yml'
11-
paths-ignore:
12-
- '**/.gitignore'
13-
- '**/Dockerfile'
14-
- '**/.dockerignore'
1511
pull_request:
1612
branches: [ "main", "dev", "demo" ]
1713
paths:
1814
- 'App/backend-api/**'
1915
- 'App/frontend-app/**'
2016
- 'App/kernel-memory/**'
2117
- '.github/workflows/codeql.yml'
22-
paths-ignore:
23-
- '**/.gitignore'
24-
- '**/Dockerfile'
25-
- '**/.dockerignore'
2618
schedule:
2719
- cron: '37 2 * * 5'
2820

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Deployment orchestrator
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
azure_location:
7+
description: 'Azure Location For Deployment'
8+
required: false
9+
default: 'australiaeast'
10+
type: string
11+
resource_group_name:
12+
description: 'Resource Group Name (Optional)'
13+
required: false
14+
default: ''
15+
type: string
16+
waf_enabled:
17+
description: 'Enable WAF'
18+
required: false
19+
default: false
20+
type: boolean
21+
EXP:
22+
description: 'Enable EXP'
23+
required: false
24+
default: false
25+
type: boolean
26+
cleanup_resources:
27+
description: 'Cleanup Deployed Resources'
28+
required: false
29+
default: false
30+
type: boolean
31+
run_e2e_tests:
32+
description: 'Run End-to-End Tests'
33+
required: false
34+
default: 'GoldenPath-Testing'
35+
type: string
36+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID:
37+
description: 'Log Analytics Workspace ID (Optional)'
38+
required: false
39+
default: ''
40+
type: string
41+
existing_webapp_url:
42+
description: 'Existing Container WebApp URL (Skips Deployment)'
43+
required: false
44+
default: ''
45+
type: string
46+
trigger_type:
47+
description: 'Trigger type (workflow_dispatch, pull_request, schedule)'
48+
required: true
49+
type: string
50+
51+
env:
52+
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
53+
54+
jobs:
55+
deploy:
56+
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
57+
uses: ./.github/workflows/job-deploy.yml
58+
with:
59+
trigger_type: ${{ inputs.trigger_type }}
60+
azure_location: ${{ inputs.azure_location }}
61+
resource_group_name: ${{ inputs.resource_group_name }}
62+
waf_enabled: ${{ inputs.waf_enabled }}
63+
EXP: ${{ inputs.EXP }}
64+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
65+
AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID: ${{ inputs.AZURE_ENV_LOG_ANALYTICS_WORKSPACE_ID }}
66+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
67+
cleanup_resources: ${{ inputs.cleanup_resources }}
68+
secrets: inherit
69+
70+
e2e-test:
71+
if: "!cancelled() && ((needs.deploy.outputs.WEB_APPURL != '' && needs.deploy.outputs.WEB_APPURL != null) || (inputs.existing_webapp_url != '' && inputs.existing_webapp_url != null)) && (inputs.trigger_type != 'workflow_dispatch' || (inputs.run_e2e_tests != 'None' && inputs.run_e2e_tests != '' && inputs.run_e2e_tests != null))"
72+
needs: [deploy]
73+
uses: ./.github/workflows/test-automation-v2.yml
74+
with:
75+
TEST_URL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
76+
TEST_SUITE: ${{ inputs.trigger_type == 'workflow_dispatch' && inputs.run_e2e_tests || 'GoldenPath-Testing' }}
77+
secrets: inherit
78+
79+
send-notification:
80+
# if: "!cancelled()"
81+
if: false # Temporarily disable notification job
82+
needs: [deploy, e2e-test]
83+
uses: ./.github/workflows/job-send-notification.yml
84+
with:
85+
trigger_type: ${{ inputs.trigger_type }}
86+
waf_enabled: ${{ inputs.waf_enabled }}
87+
EXP: ${{ inputs.EXP }}
88+
run_e2e_tests: ${{ inputs.run_e2e_tests }}
89+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
90+
deploy_result: ${{ needs.deploy.result }}
91+
e2e_test_result: ${{ needs.e2e-test.result }}
92+
WEB_APPURL: ${{ needs.deploy.outputs.WEB_APPURL || inputs.existing_webapp_url }}
93+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
94+
QUOTA_FAILED: ${{ needs.deploy.outputs.QUOTA_FAILED }}
95+
TEST_SUCCESS: ${{ needs.e2e-test.outputs.TEST_SUCCESS }}
96+
TEST_REPORT_URL: ${{ needs.e2e-test.outputs.TEST_REPORT_URL }}
97+
secrets: inherit
98+
99+
cleanup-deployment:
100+
if: "!cancelled() && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
101+
needs: [deploy, e2e-test]
102+
uses: ./.github/workflows/job-cleanup-deployment.yml
103+
with:
104+
trigger_type: ${{ inputs.trigger_type }}
105+
cleanup_resources: ${{ inputs.cleanup_resources }}
106+
existing_webapp_url: ${{ inputs.existing_webapp_url }}
107+
RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
108+
AZURE_LOCATION: ${{ needs.deploy.outputs.AZURE_LOCATION }}
109+
AZURE_ENV_OPENAI_LOCATION: ${{ needs.deploy.outputs.AZURE_ENV_OPENAI_LOCATION }}
110+
ENV_NAME: ${{ needs.deploy.outputs.ENV_NAME }}
111+
IMAGE_TAG: ${{ needs.deploy.outputs.IMAGE_TAG }}
112+
secrets: inherit

0 commit comments

Comments
 (0)