Skip to content

Commit 8e85a0d

Browse files
fixed copilot suggested fixes
1 parent e75ff5f commit 8e85a0d

File tree

6 files changed

+32
-40
lines changed

6 files changed

+32
-40
lines changed
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,6 @@ on:
6767
required: false
6868
default: ''
6969
type: string
70-
71-
# schedule:
72-
# - cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
7370

7471
jobs:
7572
Run:

.github/workflows/deploy-orchestrator.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ env:
5353

5454
jobs:
5555
deploy:
56-
if: always() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)
56+
if: "!cancelled() && (inputs.trigger_type != 'workflow_dispatch' || inputs.existing_webapp_url == '' || inputs.existing_webapp_url == null)"
5757
uses: ./.github/workflows/job-deploy.yml
5858
with:
5959
trigger_type: ${{ inputs.trigger_type }}
@@ -68,7 +68,7 @@ jobs:
6868
secrets: inherit
6969

7070
e2e-test:
71-
if: always() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (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))
71+
if: "!cancelled() && ((needs.deploy.result == 'success' && needs.deploy.outputs.WEB_APPURL != '') || (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))"
7272
needs: [deploy]
7373
uses: ./.github/workflows/test-automation-v2.yml
7474
with:
@@ -77,7 +77,7 @@ jobs:
7777
secrets: inherit
7878

7979
send-notification:
80-
if: always()
80+
if: "!cancelled()"
8181
needs: [deploy, e2e-test]
8282
uses: ./.github/workflows/job-send-notification.yml
8383
with:
@@ -96,7 +96,7 @@ jobs:
9696
secrets: inherit
9797

9898
cleanup-deployment:
99-
if: always() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)
99+
if: "!cancelled() && needs.deploy.result == 'success' && needs.deploy.outputs.RESOURCE_GROUP_NAME != '' && inputs.existing_webapp_url == '' && (inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources)"
100100
needs: [deploy, e2e-test]
101101
uses: ./.github/workflows/job-cleanup-deployment.yml
102102
with:

.github/workflows/job-cleanup-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Login to Azure
6060
shell: bash
6161
run: |
62-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
62+
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
6363
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
6464
6565
- name: Delete Resource Group (Optimized Cleanup)
Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ on:
3131
outputs:
3232
WEB_APPURL:
3333
description: "Container Web App URL"
34-
value: ${{ jobs.deploy-windows.outputs.WEB_APPURL }}
34+
value: ${{ jobs.deploy-linux.outputs.WEB_APPURL }}
3535

3636
jobs:
37-
deploy-windows:
37+
deploy-linux:
3838
runs-on: ubuntu-latest
3939
env:
4040
AZURE_DEV_COLLECT_TELEMETRY: ${{ vars.AZURE_DEV_COLLECT_TELEMETRY }}
@@ -70,10 +70,10 @@ jobs:
7070
shell: bash
7171
run: |
7272
# If helm is already available on the runner, print version and skip installation
73-
if command -v helm >/dev/null 2>&1; then
74-
echo "helm already installed: $(helm version --short 2>/dev/null || true)"
75-
exit 0
76-
fi
73+
if command -v helm >/dev/null 2>&1; then
74+
echo "helm already installed: $(helm version --short 2>/dev/null || true)"
75+
exit 0
76+
fi
7777
7878
# Ensure prerequisites are present
7979
sudo apt-get update
@@ -106,7 +106,7 @@ jobs:
106106

107107
- name: Login to Azure
108108
run: |
109-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
109+
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
110110
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
111111
azd auth login --client-id ${{ secrets.AZURE_CLIENT_ID }} --client-secret ${{ secrets.AZURE_CLIENT_SECRET }} --tenant-id ${{ secrets.AZURE_TENANT_ID }}
112112
@@ -124,7 +124,7 @@ jobs:
124124
azd env set AZURE_ENV_OPENAI_LOCATION="${{ inputs.AZURE_ENV_OPENAI_LOCATION }}"
125125
azd env set AZURE_LOCATION="${{ inputs.AZURE_LOCATION }}"
126126
azd env set AZURE_RESOURCE_GROUP="${{ inputs.RESOURCE_GROUP_NAME }}"
127-
azd env set AZURE_ENV_IMAGETAG="${{ inputs.IMAGE_TAG }}"
127+
azd env set AZURE_ENV_IMAGE_TAG="${{ inputs.IMAGE_TAG }}"
128128
129129
# Set AI model capacity parameters
130130
azd env set AZURE_ENV_MODEL_CAPACITY="150"
@@ -167,7 +167,7 @@ jobs:
167167
168168
# Get AKS node resource group if AKS exists
169169
if [ -n "$AZURE_AKS_NAME" ]; then
170-
krg_name=$(az aks show --name "$AZURE_AKS_NAME" --resource-group "$RESOURCE_GROUP_NAME" --query "nodeResourceGroup" -o tsv || echo "")
170+
krg_name=$(az aks show --name "$AZURE_AKS_NAME" --resource-group "${{ inputs.RESOURCE_GROUP_NAME }}" --query "nodeResourceGroup" -o tsv || echo "")
171171
if [ -n "$krg_name" ]; then
172172
echo "krg_name=$krg_name" >> $GITHUB_ENV
173173
echo "AKS node resource group: $krg_name"
@@ -216,14 +216,6 @@ jobs:
216216
id: get_webapp_url
217217
shell: bash
218218
run: |
219-
if az account show &> /dev/null; then
220-
echo "Azure CLI is authenticated."
221-
else
222-
echo "Azure CLI is not authenticated. Logging in..."
223-
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
224-
fi
225-
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
226-
227219
# Get the Web App URL and save it to GITHUB_OUTPUT
228220
echo "Retrieving Web App URL..."
229221
public_ip_name=$(az network public-ip list --resource-group ${{ env.krg_name }} --query "[?contains(name, 'kubernetes-')].name" -o tsv)
@@ -300,15 +292,15 @@ jobs:
300292
if: always()
301293
shell: bash
302294
run: |
303-
echo "## 🚀 Deploy Job Summary (Windows)" >> $GITHUB_STEP_SUMMARY
295+
echo "## 🚀 Deploy Job Summary (Linux)" >> $GITHUB_STEP_SUMMARY
304296
echo "" >> $GITHUB_STEP_SUMMARY
305297
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
306298
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
307299
echo "| **Job Status** | ${{ job.status == 'success' && '✅ Success' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
308300
echo "| **Resource Group** | \`${{ inputs.RESOURCE_GROUP_NAME }}\` |" >> $GITHUB_STEP_SUMMARY
309301
echo "| **Configuration Type** | \`${{ inputs.WAF_ENABLED == 'true' && inputs.EXP == 'true' && 'WAF + EXP' || inputs.WAF_ENABLED == 'true' && inputs.EXP != 'true' && 'WAF + Non-EXP' || inputs.WAF_ENABLED != 'true' && inputs.EXP == 'true' && 'Non-WAF + EXP' || 'Non-WAF + Non-EXP' }}\` |" >> $GITHUB_STEP_SUMMARY
310302
echo "| **Azure Region (Infrastructure)** | \`${{ inputs.AZURE_LOCATION }}\` |" >> $GITHUB_STEP_SUMMARY
311-
echo "| **Azure OpenAI Region** | \`${{ inputs.AZURE_LOCATION }}\` |" >> $GITHUB_STEP_SUMMARY
303+
echo "| **Azure OpenAI Region** | \`${{ inputs.AZURE_ENV_OPENAI_LOCATION }}\` |" >> $GITHUB_STEP_SUMMARY
312304
echo "| **Docker Image Tag** | \`${{ inputs.IMAGE_TAG }}\` |" >> $GITHUB_STEP_SUMMARY
313305
echo "" >> $GITHUB_STEP_SUMMARY
314306
if [[ "${{ job.status }}" == "success" ]]; then

.github/workflows/job-deploy.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
- name: Login to Azure
119119
shell: bash
120120
run: |
121-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
121+
az login --service-principal --username ${{ secrets.AZURE_CLIENT_ID }} --password ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
122122
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
123123
124124
- name: Run Quota Check
@@ -130,21 +130,20 @@ jobs:
130130
# Path to the PowerShell script for quota check
131131
$quotaCheckScript = "Deployment/checkquota.ps1"
132132
133-
# Check if the script exists and is executable (not needed for PowerShell like chmod)
133+
# Check if the script exists
134134
if (-not (Test-Path $quotaCheckScript)) {
135135
Write-Host "❌ Error: Quota check script not found."
136136
exit 1
137137
}
138138
139-
# Run the script
140-
.\Deployment\checkquota.ps1
139+
# Run the script and capture its output (stdout and stderr)
140+
$output = & $quotaCheckScript 2>&1
141+
$exitCode = $LASTEXITCODE
141142
142-
# If the script fails, check for the failure message
143+
# Check the execution output for the quota failure message
143144
$quotaFailedMessage = "No region with sufficient quota found"
144-
$output = Get-Content "Deployment/checkquota.ps1"
145-
146-
if ($output -contains $quotaFailedMessage) {
147-
echo "QUOTA_FAILED=true" >> $GITHUB_ENV
145+
if ($output -match [Regex]::Escape($quotaFailedMessage) -or $exitCode -ne 0) {
146+
echo "QUOTA_FAILED=true" >> $env:GITHUB_ENV
148147
}
149148
env:
150149
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
@@ -311,8 +310,8 @@ jobs:
311310
deploy-linux:
312311
name: Deploy
313312
needs: azure-setup
314-
if: "!Cancelled() && needs.azure-setup.result == 'success'"
315-
uses: ./.github/workflows/job-deploy-windows.yml
313+
if: "!cancelled() && needs.azure-setup.result == 'success'"
314+
uses: ./.github/workflows/job-deploy-linux.yml
316315
with:
317316
ENV_NAME: ${{ needs.azure-setup.outputs.ENV_NAME }}
318317
AZURE_ENV_OPENAI_LOCATION: ${{ needs.azure-setup.outputs.AZURE_ENV_OPENAI_LOCATION }}

.github/workflows/test-automation-v2.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
env:
2424
url: ${{ inputs.Test_URL }}
25-
accelerator_name: "Dkm"
25+
accelerator_name: "DKM"
2626
test_suite: ${{ inputs.TEST_SUITE }}
2727

2828
jobs:
@@ -41,8 +41,12 @@ jobs:
4141
python-version: '3.13'
4242

4343
- name: Login to Azure
44+
env:
45+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
46+
AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
47+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
4448
run: |
45-
az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
49+
az login --service-principal --username "$AZURE_CLIENT_ID" --password "$AZURE_CLIENT_SECRET" --tenant "$AZURE_TENANT_ID"
4650
az account set --subscription ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4751
4852
- name: Install dependencies

0 commit comments

Comments
 (0)