Skip to content

Commit 4b2af3f

Browse files
Merge pull request #921 from microsoft/psl-workflowchanges
feat: Enhance email template, add RG owner tag, scalability input
2 parents f2c2e3d + d806651 commit 4b2af3f

7 files changed

Lines changed: 530 additions & 109 deletions

File tree

.github/workflows/deploy-KMGeneric.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,18 @@ jobs:
9696
- name: Check and Create Resource Group
9797
id: check_create_rg
9898
run: |
99-
set -e
100-
echo "Checking if resource group exists..."
99+
set -e
100+
OWNER_TAG_VALUE="${{ github.actor }}"
101+
echo "🔍 Checking if resource group '${{ env.RESOURCE_GROUP_NAME }}' exists..."
101102
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
102103
if [ "$rg_exists" = "false" ]; then
103-
echo "Resource group does not exist. Creating..."
104-
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location ${{ env.AZURE_LOCATION }} || { echo "Error creating resource group"; exit 1; }
104+
echo "📦 Resource group does not exist. Creating..."
105+
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
106+
az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location ${{ env.AZURE_LOCATION }} --tags "Owner=${OWNER_TAG_VALUE}" || { echo "❌ Error creating resource group"; exit 1; }
105107
else
106-
echo "Resource group already exists."
108+
echo "✅ Resource group already exists."
109+
echo "🏷️ Adding Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
110+
az group update --name "${{ env.RESOURCE_GROUP_NAME }}" --set tags.Owner="${OWNER_TAG_VALUE}" --output none || echo "⚠️ Warning: failed to update Owner tag on existing resource group '${{ env.RESOURCE_GROUP_NAME }}'."
107111
fi
108112
echo "RESOURCE_GROUP_NAME=${{ env.RESOURCE_GROUP_NAME }}" >> $GITHUB_OUTPUT
109113
- name: Generate Unique Solution Prefix

.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 features for WAF deployments (opt-in)'
27+
required: false
28+
default: false
29+
type: boolean
2530
exp:
2631
description: 'Enable EXP'
2732
required: false
@@ -88,6 +93,7 @@ jobs:
8893
azure_location: ${{ inputs.azure_location }}
8994
resource_group_name: ${{ inputs.resource_group_name }}
9095
waf_enabled: ${{ inputs.waf_enabled }}
96+
enable_scalability: ${{ inputs.enable_scalability }}
9197
exp: ${{ inputs.exp }}
9298
build_docker_image: ${{ inputs.build_docker_image }}
9399
existing_webapp_url: ${{ inputs.existing_webapp_url }}

.github/workflows/deploy-v2.yml

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,41 +31,46 @@ on:
3131
default: 'codespace'
3232

3333
azure_location:
34-
description: 'Azure Location For Deployment'
34+
description: 'Azure Region (Non-AI Services)'
3535
required: false
3636
default: 'australiaeast'
3737
type: choice
3838
options:
3939
- 'australiaeast'
40-
- 'eastus'
40+
- 'centralus'
41+
- 'eastasia'
4142
- 'eastus2'
4243
- 'japaneast'
43-
- 'swedencentral'
44+
- 'northeurope'
45+
- 'southeastasia'
4446
- 'uksouth'
45-
- 'westus'
46-
- 'westus2'
4747
resource_group_name:
4848
description: 'Resource Group Name (Optional)'
4949
required: false
5050
default: ''
5151
type: string
52+
build_docker_image:
53+
description: 'Build & Use Custom Images (Optional)'
54+
required: false
55+
default: false
56+
type: boolean
5257
waf_enabled:
53-
description: 'Enable WAF'
58+
description: 'Deploy WAF'
5459
required: false
5560
default: false
5661
type: boolean
57-
EXP:
58-
description: 'Enable EXP'
62+
enable_scalability:
63+
description: 'Enable Scalability (WAF only)'
5964
required: false
6065
default: false
6166
type: boolean
62-
build_docker_image:
63-
description: 'Build And Push Docker Image (Optional)'
67+
EXP:
68+
description: 'Deploy EXP'
6469
required: false
6570
default: false
6671
type: boolean
6772
cleanup_resources:
68-
description: 'Cleanup Deployed Resources'
73+
description: 'Auto Delete RG'
6974
required: false
7075
default: false
7176
type: boolean
@@ -87,17 +92,17 @@ on:
8792
- 'Smoke-Testing'
8893
- 'None'
8994
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
90-
description: 'Log Analytics Workspace ID (Optional)'
95+
description: 'Existing Log Analytics Workspace Resource ID (Optional)'
9196
required: false
9297
default: ''
9398
type: string
9499
AZURE_EXISTING_AIPROJECT_RESOURCE_ID:
95-
description: 'AI Project Resource ID (Optional)'
100+
description: 'Existing AI Project Resource ID (Optional)'
96101
required: false
97102
default: ''
98103
type: string
99104
existing_webapp_url:
100-
description: 'Existing WebApp URL (Skips Deployment)'
105+
description: 'Run Tests Against Existing RG (Provide Web App URL)'
101106
required: false
102107
default: ''
103108
type: string
@@ -117,6 +122,7 @@ jobs:
117122
azure_location: ${{ steps.validate.outputs.azure_location }}
118123
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
119124
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
125+
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
120126
exp: ${{ steps.validate.outputs.exp }}
121127
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
122128
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
@@ -135,6 +141,7 @@ jobs:
135141
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
136142
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
137143
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
144+
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enable_scalability }}
138145
INPUT_EXP: ${{ github.event.inputs.EXP }}
139146
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
140147
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
@@ -197,6 +204,15 @@ jobs:
197204
echo "✅ waf_enabled: '$WAF_ENABLED' is valid"
198205
fi
199206
207+
# Validate enable_scalability (boolean)
208+
ENABLE_SCALABILITY="${INPUT_ENABLE_SCALABILITY:-false}"
209+
if [[ "$ENABLE_SCALABILITY" != "true" && "$ENABLE_SCALABILITY" != "false" ]]; then
210+
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY'"
211+
VALIDATION_FAILED=true
212+
else
213+
echo "✅ enable_scalability: '$ENABLE_SCALABILITY' is valid"
214+
fi
215+
200216
# Validate EXP (boolean)
201217
EXP_ENABLED="${INPUT_EXP:-false}"
202218
if [[ "$EXP_ENABLED" != "true" && "$EXP_ENABLED" != "false" ]]; then
@@ -297,6 +313,7 @@ jobs:
297313
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
298314
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
299315
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
316+
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
300317
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
301318
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
302319
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
@@ -317,6 +334,7 @@ jobs:
317334
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
318335
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
319336
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
337+
enable_scalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
320338
exp: ${{ needs.validate-inputs.outputs.exp == 'true' }}
321339
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
322340
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}

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

Lines changed: 13 additions & 2 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 features for WAF deployments (opt-in)'
31+
required: false
32+
default: false
33+
type: boolean
2934
exp:
3035
description: 'Enable EXP'
3136
required: false
@@ -412,15 +417,19 @@ jobs:
412417
id: check_create_rg
413418
shell: bash
414419
run: |
415-
set -e
420+
set -e
421+
OWNER_TAG_VALUE="${{ github.actor }}"
416422
echo "🔍 Checking if resource group '$RESOURCE_GROUP_NAME' exists..."
417423
rg_exists=$(az group exists --name $RESOURCE_GROUP_NAME)
418424
if [ "$rg_exists" = "false" ]; then
419425
echo "📦 Resource group does not exist. Creating new resource group '$RESOURCE_GROUP_NAME' in location '$AZURE_LOCATION'..."
420-
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} || { echo "❌ Error creating resource group"; exit 1; }
426+
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
427+
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} "Owner=${OWNER_TAG_VALUE}" || { echo "❌ Error creating resource group"; exit 1; }
421428
echo "✅ Resource group '$RESOURCE_GROUP_NAME' created successfully."
422429
else
423430
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Deploying to existing resource group."
431+
echo "🏷️ Adding Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
432+
az group update --name "$RESOURCE_GROUP_NAME" --set tags.Owner="${OWNER_TAG_VALUE}" --output none || echo "⚠️ Warning: failed to update Owner tag on existing resource group '$RESOURCE_GROUP_NAME'."
424433
fi
425434
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
426435
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_ENV
@@ -551,6 +560,7 @@ jobs:
551560
BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image || 'false' }}
552561
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
553562
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
563+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
554564
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.azure_env_existing_log_analytics_workspace_rid }}
555565
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.azure_existing_aiproject_resource_id }}
556566
USE_CASE: ${{ inputs.use_case }}
@@ -570,6 +580,7 @@ jobs:
570580
BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image || 'false' }}
571581
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
572582
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
583+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
573584
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.azure_env_existing_log_analytics_workspace_rid }}
574585
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.azure_existing_aiproject_resource_id }}
575586
USE_CASE: ${{ inputs.use_case }}

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

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
required: false
2929
type: string
3030
default: 'false'
31+
ENABLE_SCALABILITY:
32+
required: false
33+
type: string
34+
default: 'false'
35+
description: 'Enable scalability features for WAF deployments (true|false)'
3136
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3237
required: false
3338
type: string
@@ -206,11 +211,27 @@ jobs:
206211
- name: Configure Parameters Based on WAF Setting
207212
shell: bash
208213
env:
209-
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
214+
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
215+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
210216
run: |
211-
if [[ "$WAF_ENABLED" == "true" ]]; then
217+
set -euo pipefail
218+
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
212219
cp infra/main.waf.parameters.json infra/main.parameters.json
213220
echo "✅ Successfully copied WAF parameters to main parameters file"
221+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
222+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
223+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
224+
exit 1
225+
fi
226+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
227+
tmpfile=$(mktemp)
228+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
229+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
230+
rm -f "$tmpfile"
231+
exit 1
232+
fi
233+
mv "$tmpfile" infra/main.parameters.json
234+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
214235
else
215236
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
216237
fi

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
required: false
2929
type: string
3030
default: 'false'
31+
ENABLE_SCALABILITY:
32+
required: false
33+
type: string
34+
default: 'false'
35+
description: 'Enable scalability features for WAF deployments (true|false)'
3136
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3237
required: false
3338
type: string
@@ -210,10 +215,26 @@ jobs:
210215
shell: bash
211216
env:
212217
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
218+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
213219
run: |
220+
set -euo pipefail
214221
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
215222
cp infra/main.waf.parameters.json infra/main.parameters.json
216223
echo "✅ Successfully copied WAF parameters to main parameters file"
224+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
225+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
226+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
227+
exit 1
228+
fi
229+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
230+
tmpfile=$(mktemp)
231+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
232+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
233+
rm -f "$tmpfile"
234+
exit 1
235+
fi
236+
mv "$tmpfile" infra/main.parameters.json
237+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
217238
else
218239
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
219240
fi

0 commit comments

Comments
 (0)