Skip to content

Commit 280028c

Browse files
feat: Enhance email template, add RG owner tag, scalability input
1 parent d6066e3 commit 280028c

8 files changed

Lines changed: 538 additions & 99 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+
enableScalability:
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
@@ -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+
enableScalability: ${{ inputs.enableScalability }}
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: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131
- 'Local'
3232
default: 'codespace'
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
@@ -49,25 +49,31 @@ on:
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

5358
waf_enabled:
54-
description: 'Enable WAF'
59+
description: 'Deploy WAF'
5560
required: false
5661
default: false
5762
type: boolean
5863
EXP:
59-
description: 'Enable EXP'
64+
description: 'Deploy EXP'
6065
required: false
6166
default: false
6267
type: boolean
63-
build_docker_image:
64-
description: 'Build And Push Docker Image (Optional)'
68+
69+
enableScalability:
70+
description: 'Enable Scalability'
6571
required: false
6672
default: false
6773
type: boolean
6874

6975
cleanup_resources:
70-
description: 'Cleanup Deployed Resources'
76+
description: 'Auto Delete RG'
7177
required: false
7278
default: false
7379
type: boolean
@@ -83,17 +89,17 @@ on:
8389
- 'None'
8490

8591
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID:
86-
description: 'Log Analytics Workspace Resource ID (Optional)'
92+
description: 'Existing Log Analytics Workspace Resource ID (Optional)'
8793
required: false
8894
default: ''
8995
type: string
9096
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID:
91-
description: 'AI Project Resource ID (Optional)'
97+
description: 'Existing AI Project Resource ID (Optional)'
9298
required: false
9399
default: ''
94100
type: string
95101
existing_webapp_url:
96-
description: 'Existing Container WebApp URL (Skips Deployment)'
102+
description: 'Run Tests Against Existing RG (Provide Web App URL)'
97103
required: false
98104
default: ''
99105
type: string
@@ -113,6 +119,7 @@ jobs:
113119
azure_location: ${{ steps.validate.outputs.azure_location }}
114120
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
115121
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
122+
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
116123
exp: ${{ steps.validate.outputs.exp }}
117124
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
118125
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
@@ -128,6 +135,7 @@ jobs:
128135
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
129136
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
130137
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
138+
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enableScalability }}
131139
INPUT_EXP: ${{ github.event.inputs.EXP }}
132140
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
133141
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
@@ -187,6 +195,18 @@ jobs:
187195
else
188196
echo "✅ waf_enabled: '$WAF_ENABLED' is valid"
189197
fi
198+
199+
# Validate enableScalability (boolean, WAF-only opt-in)
200+
ENABLE_SCALABILITY="${INPUT_ENABLE_SCALABILITY:-false}"
201+
if [[ "$ENABLE_SCALABILITY" != "true" && "$ENABLE_SCALABILITY" != "false" ]]; then
202+
echo "❌ ERROR: enableScalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY'"
203+
VALIDATION_FAILED=true
204+
else
205+
echo "✅ enableScalability: '$ENABLE_SCALABILITY' is valid"
206+
if [[ "$ENABLE_SCALABILITY" == "true" && "$WAF_ENABLED" != "true" ]]; then
207+
echo "ℹ️ Note: enableScalability=true only applies when waf_enabled=true; it will be ignored for non-WAF deployments."
208+
fi
209+
fi
190210
191211
# Validate EXP (boolean)
192212
EXP_ENABLED="${INPUT_EXP:-false}"
@@ -280,6 +300,7 @@ jobs:
280300
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
281301
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
282302
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
303+
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
283304
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
284305
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
285306
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
@@ -297,6 +318,7 @@ jobs:
297318
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
298319
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
299320
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
321+
enableScalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
300322
EXP: ${{ needs.validate-inputs.outputs.exp == 'true' }}
301323
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
302324
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}

.github/workflows/deploy-windows.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ on:
3030
required: false
3131
default: false
3232
type: boolean
33+
enableScalability:
34+
description: 'Enable Scalability (WAF only - opt-in)'
35+
required: false
36+
default: false
37+
type: boolean
3338
EXP:
3439
description: 'Enable EXP'
3540
required: false
@@ -87,6 +92,7 @@ jobs:
8792
azure_location: ${{ steps.validate.outputs.azure_location }}
8893
resource_group_name: ${{ steps.validate.outputs.resource_group_name }}
8994
waf_enabled: ${{ steps.validate.outputs.waf_enabled }}
95+
enable_scalability: ${{ steps.validate.outputs.enable_scalability }}
9096
exp: ${{ steps.validate.outputs.exp }}
9197
build_docker_image: ${{ steps.validate.outputs.build_docker_image }}
9298
cleanup_resources: ${{ steps.validate.outputs.cleanup_resources }}
@@ -102,6 +108,7 @@ jobs:
102108
INPUT_AZURE_LOCATION: ${{ github.event.inputs.azure_location }}
103109
INPUT_RESOURCE_GROUP_NAME: ${{ github.event.inputs.resource_group_name }}
104110
INPUT_WAF_ENABLED: ${{ github.event.inputs.waf_enabled }}
111+
INPUT_ENABLE_SCALABILITY: ${{ github.event.inputs.enableScalability }}
105112
INPUT_EXP: ${{ github.event.inputs.EXP }}
106113
INPUT_BUILD_DOCKER_IMAGE: ${{ github.event.inputs.build_docker_image }}
107114
INPUT_CLEANUP_RESOURCES: ${{ github.event.inputs.cleanup_resources }}
@@ -147,6 +154,18 @@ jobs:
147154
echo "✅ waf_enabled: '$WAF_ENABLED' is valid"
148155
fi
149156
157+
# Validate enableScalability (boolean, WAF-only opt-in)
158+
ENABLE_SCALABILITY="${INPUT_ENABLE_SCALABILITY:-false}"
159+
if [[ "$ENABLE_SCALABILITY" != "true" && "$ENABLE_SCALABILITY" != "false" ]]; then
160+
echo "❌ ERROR: enableScalability must be 'true' or 'false', got: '$ENABLE_SCALABILITY'"
161+
VALIDATION_FAILED=true
162+
else
163+
echo "✅ enableScalability: '$ENABLE_SCALABILITY' is valid"
164+
if [[ "$ENABLE_SCALABILITY" == "true" && "$WAF_ENABLED" != "true" ]]; then
165+
echo "ℹ️ Note: enableScalability=true only applies when waf_enabled=true; it will be ignored for non-WAF deployments."
166+
fi
167+
fi
168+
150169
# Validate EXP (boolean)
151170
EXP_ENABLED="${INPUT_EXP:-false}"
152171
if [[ "$EXP_ENABLED" != "true" && "$EXP_ENABLED" != "false" ]]; then
@@ -238,6 +257,7 @@ jobs:
238257
echo "azure_location=$LOCATION" >> $GITHUB_OUTPUT
239258
echo "resource_group_name=$INPUT_RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
240259
echo "waf_enabled=$WAF_ENABLED" >> $GITHUB_OUTPUT
260+
echo "enable_scalability=$ENABLE_SCALABILITY" >> $GITHUB_OUTPUT
241261
echo "exp=$EXP_ENABLED" >> $GITHUB_OUTPUT
242262
echo "build_docker_image=$BUILD_DOCKER" >> $GITHUB_OUTPUT
243263
echo "cleanup_resources=$CLEANUP_RESOURCES" >> $GITHUB_OUTPUT
@@ -255,6 +275,7 @@ jobs:
255275
azure_location: ${{ needs.validate-inputs.outputs.azure_location || 'australiaeast' }}
256276
resource_group_name: ${{ needs.validate-inputs.outputs.resource_group_name || '' }}
257277
waf_enabled: ${{ needs.validate-inputs.outputs.waf_enabled == 'true' }}
278+
enableScalability: ${{ needs.validate-inputs.outputs.enable_scalability == 'true' }}
258279
EXP: ${{ needs.validate-inputs.outputs.exp == 'true' }}
259280
build_docker_image: ${{ needs.validate-inputs.outputs.build_docker_image == 'true' }}
260281
cleanup_resources: ${{ needs.validate-inputs.outputs.cleanup_resources == 'true' }}

.github/workflows/deploy.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ jobs:
102102
id: check_create_rg
103103
run: |
104104
set -e
105+
OWNER_TAG_VALUE="${{ github.actor }}"
105106
echo "Checking if resource group exists..."
106107
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
107108
if [ "$rg_exists" = "false" ]; then
108109
echo "Resource group does not exist. Creating..."
110+
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
109111
110112
# Generate current timestamp in desired format: YYYY-MM-DDTHH:MM:SS.SSSSSSSZ
111113
current_date=$(date -u +"%Y-%m-%dT%H:%M:%S.%7NZ")
@@ -115,9 +117,12 @@ jobs:
115117
"Purpose=Deploying and Cleaning Up Resources for Validation" \
116118
"CreatedDate=$current_date" \
117119
"ApplicationName=Content Processing Accelerator" \
120+
"Owner=${OWNER_TAG_VALUE}" \
118121
|| { echo "Error creating resource group"; exit 1; }
119122
else
120123
echo "Resource group already exists."
124+
echo "🏷️ Merging Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
125+
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 }}'."
121126
fi
122127
123128
- name: Generate Environment Name

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

Lines changed: 17 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+
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
@@ -188,12 +193,24 @@ jobs:
188193
shell: bash
189194
env:
190195
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
196+
ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191197
run: |
192198
if [[ "$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_VAL="${ENABLE_SCALABILITY:-false}"
202+
if [[ "$SCALABILITY_VAL" != "true" && "$SCALABILITY_VAL" != "false" ]]; then
203+
echo "⚠️ Invalid ENABLE_SCALABILITY value '$SCALABILITY_VAL'; defaulting to false."
204+
SCALABILITY_VAL="false"
205+
fi
206+
echo "🔧 Setting enableScalability=$SCALABILITY_VAL in infra/main.parameters.json (WAF deployment)"
207+
jq --argjson val "$SCALABILITY_VAL" '.parameters.enableScalability.value = $val' infra/main.parameters.json > infra/main.parameters.tmp.json \
208+
&& mv infra/main.parameters.tmp.json infra/main.parameters.json
195209
else
196210
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
211+
if [[ "${ENABLE_SCALABILITY:-false}" == "true" ]]; then
212+
echo "ℹ️ enableScalability=true was provided but WAF is disabled; the flag will be ignored for this deployment."
213+
fi
197214
fi
198215
199216
- name: Install azd

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

Lines changed: 17 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+
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
@@ -188,12 +193,24 @@ jobs:
188193
shell: bash
189194
env:
190195
WAF_ENABLED: ${{ inputs.WAF_ENABLED }}
196+
ENABLE_SCALABILITY: ${{ inputs.ENABLE_SCALABILITY }}
191197
run: |
192198
if [[ "$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_VAL="${ENABLE_SCALABILITY:-false}"
202+
if [[ "$SCALABILITY_VAL" != "true" && "$SCALABILITY_VAL" != "false" ]]; then
203+
echo "⚠️ Invalid ENABLE_SCALABILITY value '$SCALABILITY_VAL'; defaulting to false."
204+
SCALABILITY_VAL="false"
205+
fi
206+
echo "🔧 Setting enableScalability=$SCALABILITY_VAL in infra/main.parameters.json (WAF deployment)"
207+
jq --argjson val "$SCALABILITY_VAL" '.parameters.enableScalability.value = $val' infra/main.parameters.json > infra/main.parameters.tmp.json \
208+
&& mv infra/main.parameters.tmp.json infra/main.parameters.json
195209
else
196210
echo "🔧 Configuring Non-WAF deployment - using default main.parameters.json..."
211+
if [[ "${ENABLE_SCALABILITY:-false}" == "true" ]]; then
212+
echo "ℹ️ enableScalability=true was provided but WAF is disabled; the flag will be ignored for this deployment."
213+
fi
197214
fi
198215
199216
- name: Setup Azure Developer CLI (Windows)

.github/workflows/job-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+
enableScalability:
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
@@ -400,15 +405,19 @@ jobs:
400405
id: check_create_rg
401406
shell: bash
402407
run: |
403-
set -e
408+
set -e
409+
OWNER_TAG_VALUE="${{ github.actor }}"
404410
echo "🔍 Checking if resource group '$RESOURCE_GROUP_NAME' exists..."
405411
rg_exists=$(az group exists --name $RESOURCE_GROUP_NAME)
406412
if [ "$rg_exists" = "false" ]; then
407413
echo "📦 Resource group does not exist. Creating new resource group '$RESOURCE_GROUP_NAME' in location '$AZURE_LOCATION'..."
408-
az group create --name $RESOURCE_GROUP_NAME --location $AZURE_LOCATION --tags ${{ env.RG_TAGS }} || { echo "❌ Error creating resource group"; exit 1; }
414+
echo "🏷️ Adding Owner tag: Owner=${OWNER_TAG_VALUE}"
415+
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; }
409416
echo "✅ Resource group '$RESOURCE_GROUP_NAME' created successfully."
410417
else
411418
echo "✅ Resource group '$RESOURCE_GROUP_NAME' already exists. Deploying to existing resource group."
419+
echo "🏷️ Merging Owner tag on existing resource group: Owner=${OWNER_TAG_VALUE}"
420+
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'."
412421
fi
413422
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_OUTPUT
414423
echo "RESOURCE_GROUP_NAME=$RESOURCE_GROUP_NAME" >> $GITHUB_ENV
@@ -536,6 +545,7 @@ jobs:
536545
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
537546
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
538547
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
548+
ENABLE_SCALABILITY: ${{ inputs.enableScalability == true && 'true' || 'false' }}
539549
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
540550
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
541551
secrets: inherit
@@ -554,6 +564,7 @@ jobs:
554564
BUILD_DOCKER_IMAGE: ${{ inputs.build_docker_image || 'false' }}
555565
EXP: ${{ needs.azure-setup.outputs.EXP_ENABLED }}
556566
WAF_ENABLED: ${{ inputs.waf_enabled == true && 'true' || 'false' }}
567+
ENABLE_SCALABILITY: ${{ inputs.enableScalability == true && 'true' || 'false' }}
557568
AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID: ${{ inputs.AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID }}
558569
AZURE_EXISTING_AI_PROJECT_RESOURCE_ID: ${{ inputs.AZURE_EXISTING_AI_PROJECT_RESOURCE_ID }}
559570
secrets: inherit

0 commit comments

Comments
 (0)