Skip to content

Commit 635f39e

Browse files
Merge pull request #434 from microsoft/dev
fix: merging dev to main
2 parents 5d8fbea + e62acf2 commit 635f39e

12 files changed

Lines changed: 707 additions & 115 deletions

File tree

.github/workflows/deploy-orchestrator.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
required: false
2323
default: false
2424
type: boolean
25+
enable_scalability:
26+
description: 'Enable Scalability (only applies when WAF is enabled)'
27+
required: false
28+
default: false
29+
type: boolean
2530
EXP:
2631
description: 'Enable EXP'
2732
required: false
@@ -83,6 +88,7 @@ jobs:
8388
azure_location: ${{ inputs.azure_location }}
8489
resource_group_name: ${{ inputs.resource_group_name }}
8590
waf_enabled: ${{ inputs.waf_enabled }}
91+
enable_scalability: ${{ inputs.enable_scalability }}
8692
EXP: ${{ inputs.EXP }}
8793
build_docker_image: ${{ inputs.build_docker_image }}
8894
existing_webapp_url: ${{ inputs.existing_webapp_url }}

.github/workflows/deploy-v2.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,49 @@ on:
2323
- 'Local'
2424
default: 'codespace'
2525
azure_location:
26-
description: 'Azure Location For Deployment'
26+
description: 'Azure Region (Non-AI Services)'
2727
required: false
2828
default: 'australiaeast'
2929
type: choice
3030
options:
3131
- 'australiaeast'
3232
- 'centralus'
3333
- 'eastasia'
34+
- 'eastus'
3435
- 'eastus2'
3536
- 'japaneast'
3637
- 'northeurope'
3738
- 'southeastasia'
3839
- 'uksouth'
40+
- 'westeurope'
3941
resource_group_name:
4042
description: 'Resource Group Name (Optional)'
4143
required: false
4244
default: ''
4345
type: string
46+
47+
build_docker_image:
48+
description: 'Build & Use Custom Images (Optional)'
49+
required: false
50+
default: false
51+
type: boolean
4452
waf_enabled:
45-
description: 'Enable WAF'
53+
description: 'Deploy WAF'
4654
required: false
4755
default: false
4856
type: boolean
4957
EXP:
50-
description: 'Enable EXP'
58+
description: 'Deploy EXP'
5159
required: false
5260
default: false
5361
type: boolean
54-
build_docker_image:
55-
description: 'Build & Push Docker Image (Optional)'
62+
enable_scalability:
63+
description: 'Enable Scalability'
5664
required: false
5765
default: false
5866
type: boolean
5967
cleanup_resources:
60-
description: 'Cleanup Deployed Resources'
68+
description: 'Auto Delete RG'
6169
required: false
6270
default: false
6371
type: boolean
@@ -71,17 +79,17 @@ on:
7179
- 'Smoke-Testing'
7280
- 'None'
7381
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
74-
description: 'Log Analytics Workspace Resource ID (Optional)'
82+
description: 'Existing Log Analytics Workspace Resource ID (Optional)'
7583
required: false
7684
default: ''
7785
type: string
7886
AZURE_EXISTING_AIPROJECT_RESOURCE_ID:
79-
description: 'Foundry Project Resource ID (Optional)'
87+
description: 'Existing AI Project Resource ID (Optional)'
8088
required: false
8189
default: ''
8290
type: string
8391
existing_webapp_url:
84-
description: 'Existing Container WebApp URL (Skips Deployment)'
92+
description: 'Run Tests Against Existing RG (Provide Web App URL)'
8593
required: false
8694
default: ''
8795
type: string
@@ -99,6 +107,7 @@ jobs:
99107
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
100108
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
101109
exp: ${{ steps.validate.outputs.exp }}
110+
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
102111
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
103112
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
104113
run_e2e_tests: ${{ steps.validate.outputs.run_e2e_tests }}
@@ -115,6 +124,7 @@ jobs:
115124
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
116125
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
117126
INPUT_EXP: ${{ github.event.inputs.EXP }}
127+
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enable_scalability }}
118128
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
119129
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
120130
INPUT_RUN_E2E_TESTS: ${{ github.event.inputs.run_e2e_tests }}
@@ -182,6 +192,21 @@ jobs:
182192
echo "✅ EXP: '$EXP_ENABLED' is valid"
183193
fi
184194
195+
# Validate enable_scalability (boolean)
196+
ENABLE_SCALABILITY="${INPUT_ENABLE_SCALABILITY:-false}"
197+
if [[ "$ENABLE_SCALABILITY" != "true" && "$ENABLE_SCALABILITY" != "false" ]]; then
198+
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY'"
199+
VALIDATION_FAILED=true
200+
else
201+
echo "✅ enable_scalability: '$ENABLE_SCALABILITY' is valid"
202+
fi
203+
204+
# enable_scalability only applies when waf_enabled=true; auto-disable otherwise
205+
if [[ "$WAF_ENABLED" != "true" && "$ENABLE_SCALABILITY" == "true" ]]; then
206+
echo "⚠️ enable_scalability=true is only supported with waf_enabled=true. Forcing enable_scalability=false."
207+
ENABLE_SCALABILITY="false"
208+
fi
209+
185210
# Validate build_docker_image (boolean)
186211
BUILD_DOCKER="${INPUT_BUILD_DOCKER_IMAGE:-false}"
187212
if [[ "$BUILD_DOCKER" != "true" && "$BUILD_DOCKER" != "false" ]]; then
@@ -266,6 +291,7 @@ jobs:
266291
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
267292
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
268293
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
294+
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
269295
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
270296
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
271297
echo "run_e2e_tests=$TEST_OPTION" >> $GITHUB_OUTPUT
@@ -283,6 +309,7 @@ jobs:
283309
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
284310
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
285311
EXP: ${{ needs.validate-inputs.outputs.exp == 'true' }}
312+
enable_scalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
286313
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
287314
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}
288315
run_e2e_tests: ${{ needs.validate-inputs.outputs.run_e2e_tests || 'GoldenPath-Testing' }}

.github/workflows/job-deploy-linux.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ on:
2828
required: false
2929
type: string
3030
default: 'false'
31+
ENABLE_SCALABILITY:
32+
required: false
33+
type: string
34+
default: 'false'
3135
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3236
required: false
3337
type: string
@@ -188,10 +192,26 @@ jobs:
188192
shell: bash
189193
env:
190194
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
195+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191196
run: |
197+
set -euo pipefail
192198
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
193199
cp infra/main.waf.parameters.json infra/main.parameters.json
194200
echo "✅ Successfully copied WAF parameters to main parameters file"
201+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
202+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
203+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
204+
exit 1
205+
fi
206+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
207+
tmpfile=$(mktemp)
208+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
209+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
210+
rm -f "$tmpfile"
211+
exit 1
212+
fi
213+
mv "$tmpfile" infra/main.parameters.json
214+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
195215
else
196216
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
197217
fi

.github/workflows/job-deploy-windows.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ on:
2828
required: false
2929
type: string
3030
default: 'false'
31+
ENABLE_SCALABILITY:
32+
required: false
33+
type: string
34+
default: 'false'
3135
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3236
required: false
3337
type: string
@@ -188,10 +192,26 @@ jobs:
188192
shell: bash
189193
env:
190194
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
195+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191196
run: |
197+
set -euo pipefail
192198
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
193199
cp infra/main.waf.parameters.json infra/main.parameters.json
194200
echo "✅ Successfully copied WAF parameters to main parameters file"
201+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
202+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
203+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
204+
exit 1
205+
fi
206+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
207+
tmpfile=$(mktemp)
208+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
209+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
210+
rm -f "$tmpfile"
211+
exit 1
212+
fi
213+
mv "$tmpfile" infra/main.parameters.json
214+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
195215
else
196216
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
197217
fi

.github/workflows/job-deploy.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ on:
2626
required: false
2727
default: false
2828
type: boolean
29+
enable_scalability:
30+
description: 'Enable Scalability (only applies when WAF is enabled)'
31+
required: false
32+
default: false
33+
type: boolean
2934
EXP:
3035
description: 'Enable EXP'
3136
required: false
@@ -362,15 +367,17 @@ jobs:
362367
rg_exists=$(az group exists --name $RESOURCE_GROUP_NAME)
363368
if [ "$rg_exists" = "false" ]; then
364369
echo "📦 Resource group does not exist. Creating new resource group '$RESOURCE_GROUP_NAME' in location '$AZURE_LOCATION'..."
365-
RG_TAGS="${{ env.RG_TAGS }}"
370+
RG_TAGS="${{ vars.RG_TAGS }}"
371+
echo "🏷️ Adding owner tag: Owner=${{ github.actor }}"
366372
if [ -n "$RG_TAGS" ]; then
367-
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags "$RG_TAGS" || { echo "❌ Error creating resource group"; exit 1; }
373+
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags $RG_TAGS "Owner=${{ github.actor }}" || { echo "❌ Error creating resource group"; exit 1; }
368374
else
369-
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION || { echo "❌ Error creating resource group"; exit 1; }
375+
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags "Owner=${{ github.actor }}" || { echo "❌ Error creating resource group"; exit 1; }
370376
fi
371377
echo "✅ Resource group '$RESOURCE_GROUP_NAME' created successfully."
372378
else
373-
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Deploying to existing resource group."
379+
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Updating Owner tag to '${{ github.actor }}'."
380+
az group update --name "$RESOURCE_GROUP_NAME" --set tags.Owner="${{ github.actor }}" >/dev/null || echo "⚠️ Warning: failed to update Owner tag on existing resource group."
374381
fi
375382
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
376383
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_ENV
@@ -484,6 +491,7 @@ jobs:
484491
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
485492
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
486493
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
494+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
487495
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
488496
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
489497
secrets: inherit
@@ -502,6 +510,7 @@ jobs:
502510
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
503511
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
504512
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
513+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
505514
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
506515
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
507516
secrets: inherit

0 commit comments

Comments
 (0)