Skip to content

Commit 999d852

Browse files
feat: Enhance email template, add RG owner tag, scalability input
1 parent 89b2064 commit 999d852

6 files changed

Lines changed: 306 additions & 56 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 (WAF only, opt-in)'
27+
required: false
28+
default: false
29+
type: boolean
2530
EXP:
2631
description: 'Enable EXP'
2732
required: false
@@ -78,6 +83,7 @@ jobs:
7883
azure_location: ${{ inputs.azure_location }}
7984
resource_group_name: ${{ inputs.resource_group_name }}
8085
waf_enabled: ${{ inputs.waf_enabled }}
86+
enable_scalability: ${{ inputs.enable_scalability }}
8187
EXP: ${{ inputs.EXP }}
8288
build_docker_image: ${{ inputs.build_docker_image }}
8389
existing_webapp_url: ${{ inputs.existing_webapp_url }}

.github/workflows/deploy-v2.yml

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,59 +43,67 @@ on:
4343
- 'Local'
4444
default: 'codespace'
4545
azure_location:
46-
description: 'Azure Location For Deployment'
46+
description: 'Azure Region (Non-AI Services)'
4747
required: false
4848
default: 'australiaeast'
4949
type: choice
5050
options:
5151
- 'australiaeast'
5252
- 'centralus'
5353
- 'eastasia'
54+
- 'eastus'
5455
- 'eastus2'
5556
- 'japaneast'
5657
- 'northeurope'
5758
- 'southeastasia'
5859
- 'uksouth'
60+
- 'westeurope'
61+
- 'westus3'
5962
resource_group_name:
6063
description: 'Resource Group Name (Optional)'
6164
required: false
6265
default: ''
6366
type: string
67+
build_docker_image:
68+
description: 'Build & Use Custom Images (Optional)'
69+
required: false
70+
default: false
71+
type: boolean
6472

6573
waf_enabled:
66-
description: 'Enable WAF'
74+
description: 'Deploy WAF'
6775
required: false
6876
default: false
6977
type: boolean
70-
EXP:
71-
description: 'Enable EXP'
78+
enable_scalability:
79+
description: 'Enable Scalability (WAF only)'
7280
required: false
7381
default: false
7482
type: boolean
75-
build_docker_image:
76-
description: 'Build And Push Docker Image (Optional)'
83+
EXP:
84+
description: 'Deploy EXP'
7785
required: false
7886
default: false
7987
type: boolean
80-
88+
8189
cleanup_resources:
82-
description: 'Cleanup Deployed Resources'
90+
description: 'Auto Delete RG'
8391
required: false
8492
default: false
8593
type: boolean
86-
94+
8795
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
88-
description: 'Log Analytics Workspace Resource ID (Optional)'
96+
description: 'Existing Log Analytics Workspace Resource ID (Optional)'
8997
required: false
9098
default: ''
9199
type: string
92100
AZURE_EXISTING_AIPROJECT_RESOURCE_ID:
93-
description: 'Full Azure AI Project Resource ID (Optional, format: /subscriptions/.../resourceGroups/.../providers/...)'
101+
description: 'Existing AI Project Resource ID (Optional)'
94102
required: false
95103
default: ''
96104
type: string
97105
existing_webapp_url:
98-
description: 'Existing WebApp URL (Skips Deployment)'
106+
description: 'Run Tests Against Existing RG (Provide Web App URL)'
99107
required: false
100108
default: ''
101109
type: string
@@ -109,6 +117,7 @@ jobs:
109117
azure_location: ${{ steps.validate.outputs.azure_location }}
110118
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
111119
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
120+
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
112121
exp: ${{ steps.validate.outputs.exp }}
113122
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
114123
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
@@ -124,6 +133,7 @@ jobs:
124133
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
125134
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
126135
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
136+
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enable_scalability }}
127137
INPUT_EXP: ${{ github.event.inputs.EXP }}
128138
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
129139
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
@@ -181,6 +191,15 @@ jobs:
181191
else
182192
echo "✅ waf_enabled: '$WAF_ENABLED' is valid"
183193
fi
194+
195+
# Validate enable_scalability (boolean, opt-in, default false)
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
184203
185204
# Validate EXP (boolean)
186205
EXP_ENABLED="${INPUT_EXP:-false}"
@@ -265,6 +284,7 @@ jobs:
265284
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
266285
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
267286
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
287+
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
268288
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
269289
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
270290
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
@@ -281,6 +301,7 @@ jobs:
281301
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
282302
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
283303
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
304+
enable_scalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
284305
EXP: ${{ needs.validate-inputs.outputs.exp == 'true' }}
285306
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
286307
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}

.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+
description: 'Enable Scalability (WAF only, opt-in)'
33+
required: false
34+
type: string
35+
default: 'false'
3136
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3237
required: false
3338
type: string
@@ -187,11 +192,27 @@ jobs:
187192
- name: Configure Parameters Based on WAF Setting
188193
shell: bash
189194
env:
190-
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
195+
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
196+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191197
run: |
192-
if [[ "$WAF_ENABLED" == "true" ]]; then
198+
set -euo pipefail
199+
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
193200
cp infra/main.waf.parameters.json infra/main.parameters.json
194201
echo "✅ Successfully copied WAF parameters to main parameters file"
202+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
203+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
204+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
205+
exit 1
206+
fi
207+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
208+
tmpfile=$(mktemp)
209+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
210+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
211+
rm -f "$tmpfile"
212+
exit 1
213+
fi
214+
mv "$tmpfile" infra/main.parameters.json
215+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
195216
else
196217
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
197218
fi

.github/workflows/job-deploy-windows.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+
description: 'Enable Scalability (WAF only, opt-in)'
33+
required: false
34+
type: string
35+
default: 'false'
3136
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
3237
required: false
3338
type: string
@@ -187,11 +192,27 @@ jobs:
187192
- name: Configure Parameters Based on WAF Setting
188193
shell: bash
189194
env:
190-
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
195+
INPUT_WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
196+
INPUT_ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191197
run: |
192-
if [[ "$WAF_ENABLED" == "true" ]]; then
198+
set -euo pipefail
199+
if [[ "$INPUT_WAF_ENABLED" == "true" ]]; then
193200
cp infra/main.waf.parameters.json infra/main.parameters.json
194201
echo "✅ Successfully copied WAF parameters to main parameters file"
202+
SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
203+
if [[ "$SCALABILITY_VALUE" != "true" && "$SCALABILITY_VALUE" != "false" ]]; then
204+
echo "❌ ERROR: ENABLE_SCALABILITY must be 'true' or 'false', got: '$SCALABILITY_VALUE'"
205+
exit 1
206+
fi
207+
echo "🔧 Setting enableScalability=${SCALABILITY_VALUE}"
208+
tmpfile=$(mktemp)
209+
if ! jq --argjson v "$SCALABILITY_VALUE" '.parameters.enableScalability.value = $v' infra/main.parameters.json > "$tmpfile"; then
210+
echo "❌ ERROR: jq failed to update enableScalability in infra/main.parameters.json"
211+
rm -f "$tmpfile"
212+
exit 1
213+
fi
214+
mv "$tmpfile" infra/main.parameters.json
215+
echo "✅ enableScalability set to ${SCALABILITY_VALUE}"
195216
else
196217
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
197218
fi

.github/workflows/job-deploy.yml

Lines changed: 24 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 (WAF only, opt-in)'
31+
required: false
32+
default: false
33+
type: boolean
2934
EXP:
3035
description: 'Enable EXP'
3136
required: false
@@ -88,6 +93,7 @@ env:
8893
GPT_MIN_CAPACITY: 500
8994
BRANCH_NAME: ${{ github.event.workflow_run.head_branch || github.head_ref || github.ref_name }}
9095
WAF_ENABLED: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.waf_enabled || false) || false }}
96+
ENABLE_SCALABILITY: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.enable_scalability || false) || false }}
9197
EXP: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.EXP || false) || false }}
9298
CLEANUP_RESOURCES: ${{ inputs.trigger_type != 'workflow_dispatch' || inputs.cleanup_resources }}
9399
BUILD_DOCKER_IMAGE: ${{ inputs.trigger_type == 'workflow_dispatch' && (inputs.build_docker_image || false) || false }}
@@ -118,6 +124,7 @@ jobs:
118124
INPUT_AZURE_LOCATION: ${{ inputs.azure_location }}
119125
INPUT_RESOURCE_GROUP_NAME: ${{ inputs.resource_group_name }}
120126
INPUT_WAF_ENABLED: ${{ inputs.waf_enabled }}
127+
INPUT_ENABLE_SCALABILITY: ${{ inputs.enable_scalability }}
121128
INPUT_EXP: ${{ inputs.EXP }}
122129
INPUT_CLEANUP_RESOURCES: ${{ inputs.cleanup_resources }}
123130
INPUT_AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
@@ -189,6 +196,15 @@ jobs:
189196
else
190197
echo "✅ waf_enabled: '$INPUT_WAF_ENABLED' is valid"
191198
fi
199+
200+
# Validate enable_scalability (boolean, opt-in, default false)
201+
ENABLE_SCALABILITY_VALUE="${INPUT_ENABLE_SCALABILITY:-false}"
202+
if [[ "$ENABLE_SCALABILITY_VALUE" != "true" && "$ENABLE_SCALABILITY_VALUE" != "false" ]]; then
203+
echo "❌ ERROR: enable_scalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY_VALUE'"
204+
VALIDATION_FAILED=true
205+
else
206+
echo "✅ enable_scalability: '$ENABLE_SCALABILITY_VALUE' is valid"
207+
fi
192208
193209
# Validate EXP (boolean)
194210
if [[ "$INPUT_EXP" != "true" && "$INPUT_EXP" != "false" ]]; then
@@ -383,15 +399,19 @@ jobs:
383399
id: check_create_rg
384400
shell: bash
385401
run: |
386-
set -e
402+
set -e
403+
OWNER_TAG_VALUE="${{ github.actor }}"
387404
echo "🔍 Checking if resource group '$RESOURCE_GROUP_NAME' exists..."
388405
rg_exists=$(az group exists --name $RESOURCE_GROUP_NAME)
389406
if [ "$rg_exists" = "false" ]; then
390407
echo "📦 Resource group does not exist. Creating new resource group '$RESOURCE_GROUP_NAME' in location '$AZURE_LOCATION'..."
391-
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} || { echo "❌ Error creating resource group"; exit 1; }
408+
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
409+
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; }
392410
echo "✅ Resource group '$RESOURCE_GROUP_NAME' created successfully."
393411
else
394412
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Deploying to existing resource group."
413+
echo "🏷️ Adding Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
414+
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'."
395415
fi
396416
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
397417
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_ENV
@@ -511,6 +531,7 @@ jobs:
511531
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
512532
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
513533
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
534+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
514535
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
515536
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
516537
secrets: inherit
@@ -529,6 +550,7 @@ jobs:
529550
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
530551
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
531552
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
553+
ENABLE_SCALABILITY: ${{ inputs.enable_scalability == true && 'true' || 'false' }}
532554
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
533555
AZURE_EXISTING_AIPROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AIPROJECT_RESOURCE_ID }}
534556
secrets: inherit

0 commit comments

Comments
 (0)