Skip to content

Commit db5227a

Browse files
Merge pull request #569 from microsoft/hb-deplywf-fix
ci: fix deploy pipeline
2 parents 6e48ce5 + d61e18d commit db5227a

File tree

2 files changed

+29
-22
lines changed

2 files changed

+29
-22
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
name: DocGen Deploy-Test-Cleanup Pipeline
22

33
on:
4-
workflow_run:
5-
workflows: ["Build Docker and Optional Push"]
6-
types:
7-
- completed
8-
branches:
9-
- main
10-
- dev
11-
- demo
12-
schedule:
13-
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
4+
pull_request:
5+
branches:
6+
- main
7+
workflow_run:
8+
workflows: ["Build Docker and Optional Push"]
9+
types:
10+
- completed
11+
branches:
12+
- main
13+
- dev
14+
- demo
15+
16+
schedule:
17+
- cron: '0 9,21 * * *' # Runs at 9:00 AM and 9:00 PM GMT
1418

1519
env:
1620
GPT_MIN_CAPACITY: 150
@@ -82,7 +86,11 @@ jobs:
8286
- name: Set Deployment Region
8387
run: |
8488
echo "Selected Region: $VALID_REGION"
89+
echo "AZURE_AI_LOCATION=$VALID_REGION" >> $GITHUB_ENV
8590
echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
91+
if [ "$VALID_REGION" == "eastus" ] || [ "$VALID_REGION" == "westus3" ]; then
92+
echo "AZURE_LOCATION=uksouth" >> $GITHUB_ENV
93+
fi
8694
8795
- name: Generate Resource Group Name
8896
id: generate_rg_name
@@ -143,14 +151,11 @@ jobs:
143151
--template-file infra/main.bicep \
144152
--parameters \
145153
solutionName="${{ env.SOLUTION_PREFIX }}" \
146-
secondaryLocation="northcentralus" \
147-
deploymentType="GlobalStandard" \
148-
gptModelName="gpt-4.1" \
149-
azureOpenaiAPIVersion="2025-01-01-preview" \
150-
gptDeploymentCapacity=${{ env.GPT_MIN_CAPACITY }} \
151-
embeddingModel="text-embedding-ada-002" \
154+
secondaryLocation="${{ env.AZURE_LOCATION }}" \
155+
location="${{ env.AZURE_LOCATION }}" \
156+
gptModelCapacity=${{ env.GPT_MIN_CAPACITY }} \
152157
embeddingDeploymentCapacity=${{ env.TEXT_EMBEDDING_MIN_CAPACITY }} \
153-
azureAiServiceLocation=${{ env.AZURE_LOCATION }} \
158+
azureAiServiceLocation=${{ env.AZURE_AI_LOCATION }} \
154159
imageTag="${IMAGE_TAG}"\
155160
createdBy="Pipeline" \
156161
tags="{'SecurityControl':'Ignore','Purpose':'Deploying and Cleaning Up Resources for Validation','CreatedDate':'$current_date'}"
@@ -180,19 +185,19 @@ jobs:
180185
181186
- name: Run Post-Deployment Script
182187
id: post_deploy
188+
env:
189+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
183190
run: |
184191
set -e
185192
az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
186193
187194
echo "Running post-deployment script..."
188195
189-
bash ./infra/scripts/copy_kb_files.sh \
196+
bash ./infra/scripts/process_sample_data.sh \
190197
"${{ env.STORAGE_ACCOUNT_NAME }}" \
191198
"${{ env.STORAGE_CONTAINER_NAME }}" \
192-
"${{ secrets.AZURE_CLIENT_ID }}"
193-
194-
bash ./infra/scripts/run_create_index_scripts.sh \
195199
"${{ env.KEY_VAULT_NAME }}" \
200+
"${{ env.COSMOSDB_ACCOUNT_NAME }}" \
196201
"${{ env.RESOURCE_GROUP_NAME }}" \
197202
"${{ env.AI_SEARCH_SERVICE_NAME }}" \
198203
"${{ secrets.AZURE_CLIENT_ID }}" \

infra/scripts/process_sample_data.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,9 @@ if [ -z "$aif_resource_id" ]; then
271271
aif_resource_id=$(azd env get-value AI_FOUNDRY_RESOURCE_ID)
272272
fi
273273

274-
azSubscriptionId=$(azd env get-value AZURE_SUBSCRIPTION_ID)
274+
# Get subscription id from azd env or from environment variable
275+
276+
azSubscriptionId=$(azd env get-value AZURE_SUBSCRIPTION_ID) || azSubscriptionId="$AZURE_SUBSCRIPTION_ID"
275277

276278
# Check if all required arguments are provided
277279
if [ -z "$storageAccount" ] || [ -z "$fileSystem" ] || [ -z "$keyvaultName" ] || [ -z "$cosmosDbAccountName" ] || [ -z "$resourceGroupName" ] || [ -z "$aif_resource_id" ] || [ -z "$aiSearchName" ]; then

0 commit comments

Comments
 (0)