Skip to content

Commit af56cca

Browse files
AjitPadhi-MicrosoftRoopan-MicrosoftPavan-Microsoftross-p-smithgpickett
authored
chore: Dev to Main (#2159)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.com> Co-authored-by: Roopan P M <v-roopanpm@microsoft.com> Co-authored-by: Pavan-Microsoft <v-kupavan@microsoft.com> Co-authored-by: Ross Smith <ross-p-smith@users.noreply.github.com> Co-authored-by: gpickett <122489228+gpickett@users.noreply.github.com> Co-authored-by: Francia Riesco <friesco@microsoft.com> Co-authored-by: Francia Riesco <Fr4nc3@users.noreply.github.com> Co-authored-by: Prajwal D C <v-dcprajwal@microsoft.com> Co-authored-by: Harmanpreet-Microsoft <v-harmanprka@microsoft.com> Co-authored-by: UtkarshMishra-Microsoft <v-utkamishra@microsoft.com> Co-authored-by: Priyanka-Microsoft <v-prisinghal@microsoft.com> Co-authored-by: Prasanjeet-Microsoft <v-singhprasa@microsoft.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Kiran-Siluveru-Microsoft <v-ksiluveru@microsoft.com> Co-authored-by: Prashant-Microsoft <v-pmalusare@microsoft.com> Co-authored-by: Rohini-Microsoft <v-rwalunj@microsoft.com> Co-authored-by: Avijit-Microsoft <v-aghorui@microsoft.com> Co-authored-by: RaviKiran-Microsoft <v-ravikirans@microsoft.com> Co-authored-by: Somesh Joshi <v-somejoshi@microsoft.com> Co-authored-by: Himanshi Agrawal <v-himagrawal@microsoft.com> Co-authored-by: pradeepjha-microsoft <v-pradeepjha@microsoft.com> Co-authored-by: Harmanpreet Kaur <v-harmanpkau@microsoft.com> Co-authored-by: Bangarraju-Microsoft <v-golib@microsoft.com> Co-authored-by: Harsh-Microsoft <v-hbangera@microsoft.com> Co-authored-by: Kanchan-Microsoft <v-knagshetti@microsoft.com> Co-authored-by: Cristopher Coronado <cristofima@hotmail.com> Co-authored-by: Cristopher Coronado Moreira <crcorona@pichincha.com> Co-authored-by: Vamshi-Microsoft <v-vamolla@microsoft.com> Co-authored-by: Thanusree-Microsoft <168087422+Thanusree-Microsoft@users.noreply.github.com> Co-authored-by: Niraj Chaudhari (Persistent Systems Inc) <v-nirajcha@microsoft.com> Co-authored-by: Rohini-Microsoft <168007985+Rohini-Microsoft@users.noreply.github.com> Co-authored-by: Kingshuk-Microsoft <v-kidatta@microsoft.com> Co-authored-by: Ayaz-Microsoft <v-ayazkhan@microsoft.com> Co-authored-by: Abdul-Microsoft <v-amujeebta@microsoft.com> Co-authored-by: Prekshith-Microsoft <v-pdj@microsoft.com> Co-authored-by: Rafi-Microsoft <v-rafmd@microsoft.com> Co-authored-by: Ragini-Microsoft <v-raginich@microsoft.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Atulku-Microsoft <v-atulku@microsoft.com> Co-authored-by: Akhileswara-Microsoft <v-golnaidu@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9c98e88 commit af56cca

40 files changed

+2146
-1879
lines changed

.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ AZURE_OPENAI_RESOURCE=
2727
AZURE_OPENAI_API_KEY=
2828
AZURE_OPENAI_MODEL=gpt-4o
2929
AZURE_OPENAI_MODEL_NAME=gpt-4o
30-
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-ada-002
30+
AZURE_OPENAI_EMBEDDING_MODEL=text-embedding-3-small
3131
AZURE_OPENAI_TEMPERATURE=0
3232
AZURE_OPENAI_TOP_P=1.0
3333
AZURE_OPENAI_MAX_TOKENS=1000

.github/workflows/broken-links-checker.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Broken Link Checker
22

33
on:
44
pull_request:
5+
paths:
6+
- '**/*.md'
7+
- '.github/workflows/broken-links-checker.yml'
58
workflow_dispatch:
69

710
permissions:

.github/workflows/build-docker-images.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,27 @@ on:
66
- main
77
- dev
88
- demo
9+
paths:
10+
- 'code/**'
11+
- '!code/tests/**'
12+
- 'docker/**'
13+
- 'package.json'
14+
- 'pyproject.toml'
15+
- '.github/workflows/build-docker-images.yml'
16+
- '.github/workflows/build-docker.yml'
917
pull_request:
1018
branches:
1119
- main
1220
- dev
1321
- demo
22+
paths:
23+
- 'code/**'
24+
- '!code/tests/**'
25+
- 'docker/**'
26+
- 'package.json'
27+
- 'pyproject.toml'
28+
- '.github/workflows/build-docker-images.yml'
29+
- '.github/workflows/build-docker.yml'
1430
types:
1531
- opened
1632
- ready_for_review

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ on:
66
- main
77
- dev
88
- demo
9+
paths:
10+
- 'infra/**'
11+
- 'scripts/**'
12+
- 'azure.yaml'
13+
- 'pyproject.toml'
14+
- 'Makefile'
15+
- '.github/workflows/ci.yml'
916
schedule:
1017
- cron: '0 8,20 * * *' # Runs at 8:00 AM and 8:00 PM GMT
1118
workflow_dispatch:

.github/workflows/job-deploy.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,13 +557,25 @@ jobs:
557557
DATABASE_TYPE: ${{ inputs.DATABASE_TYPE }}
558558
secrets: inherit
559559

560+
# Run post-deployment setup (Function App client key + PostgreSQL tables)
561+
post-deployment-setup:
562+
needs: [azure-setup, deploy-linux, deploy-windows]
563+
if: |
564+
always() &&
565+
(needs.deploy-linux.result == 'success' || needs.deploy-windows.result == 'success')
566+
uses: ./.github/workflows/job-post-deployment-setup.yml
567+
with:
568+
RESOURCE_GROUP_NAME: ${{ needs.azure-setup.outputs.RESOURCE_GROUP_NAME }}
569+
secrets: inherit
570+
560571
# Call PostgreSQL setup workflow when DATABASE_TYPE is PostgreSQL
561572
import-sample-data-postgresql:
562-
needs: [azure-setup, deploy-linux, deploy-windows]
573+
needs: [azure-setup, deploy-linux, deploy-windows, post-deployment-setup]
563574
if: |
564575
always() &&
565576
inputs.DATABASE_TYPE == 'PostgreSQL' &&
566-
(needs.deploy-linux.result == 'success' || needs.deploy-windows.result == 'success')
577+
(needs.deploy-linux.result == 'success' || needs.deploy-windows.result == 'success') &&
578+
needs.post-deployment-setup.result == 'success'
567579
uses: ./.github/workflows/import-sample-data-postgresql.yml
568580
with:
569581
RESOURCE_GROUP_NAME: ${{ needs.azure-setup.outputs.RESOURCE_GROUP_NAME }}
@@ -572,11 +584,12 @@ jobs:
572584

573585
# Call CosmosDB/Azure Search setup workflow when DATABASE_TYPE is CosmosDB
574586
import-sample-data-cosmosdb:
575-
needs: [azure-setup, deploy-linux, deploy-windows]
587+
needs: [azure-setup, deploy-linux, deploy-windows, post-deployment-setup]
576588
if: |
577589
always() &&
578590
inputs.DATABASE_TYPE == 'CosmosDB' &&
579-
(needs.deploy-linux.result == 'success' || needs.deploy-windows.result == 'success')
591+
(needs.deploy-linux.result == 'success' || needs.deploy-windows.result == 'success') &&
592+
needs.post-deployment-setup.result == 'success'
580593
uses: ./.github/workflows/import-sample-data-cosmosdb.yml
581594
with:
582595
RESOURCE_GROUP_NAME: ${{ needs.azure-setup.outputs.RESOURCE_GROUP_NAME }}
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: Post-Deployment Setup
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
RESOURCE_GROUP_NAME:
7+
description: 'Azure Resource Group name'
8+
required: true
9+
type: string
10+
workflow_call:
11+
inputs:
12+
RESOURCE_GROUP_NAME:
13+
description: 'Azure Resource Group name'
14+
required: true
15+
type: string
16+
17+
permissions:
18+
id-token: write
19+
contents: read
20+
21+
jobs:
22+
post-deployment-setup:
23+
runs-on: ubuntu-latest
24+
environment: production
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Login to Azure
30+
uses: azure/login@v2
31+
with:
32+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
33+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
34+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
35+
36+
- name: Setup Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.11'
40+
41+
- name: Install Python Dependencies
42+
shell: bash
43+
run: |
44+
pip install psycopg2-binary azure-identity
45+
46+
- name: Run Post-Deployment Setup (Attempt 1)
47+
id: setup1
48+
shell: bash
49+
env:
50+
RESOURCE_GROUP: ${{ inputs.RESOURCE_GROUP_NAME }}
51+
run: |
52+
chmod +x scripts/post_deployment_setup.sh
53+
bash scripts/post_deployment_setup.sh "$RESOURCE_GROUP"
54+
continue-on-error: true
55+
56+
- name: Wait 20 seconds before retry
57+
if: ${{ steps.setup1.outcome == 'failure' }}
58+
shell: bash
59+
run: sleep 20s
60+
61+
- name: Run Post-Deployment Setup (Attempt 2)
62+
id: setup2
63+
if: ${{ steps.setup1.outcome == 'failure' }}
64+
shell: bash
65+
env:
66+
RESOURCE_GROUP: ${{ inputs.RESOURCE_GROUP_NAME }}
67+
run: |
68+
chmod +x scripts/post_deployment_setup.sh
69+
bash scripts/post_deployment_setup.sh "$RESOURCE_GROUP"
70+
continue-on-error: true
71+
72+
- name: Wait 40 seconds before final retry
73+
if: ${{ steps.setup2.outcome == 'failure' }}
74+
shell: bash
75+
run: sleep 40s
76+
77+
- name: Run Post-Deployment Setup (Attempt 3)
78+
id: setup3
79+
if: ${{ steps.setup2.outcome == 'failure' }}
80+
shell: bash
81+
env:
82+
RESOURCE_GROUP: ${{ inputs.RESOURCE_GROUP_NAME }}
83+
run: |
84+
chmod +x scripts/post_deployment_setup.sh
85+
bash scripts/post_deployment_setup.sh "$RESOURCE_GROUP"
86+
87+
- name: Generate Post-Deployment Summary
88+
if: always()
89+
shell: bash
90+
run: |
91+
echo "## 🔧 Post-Deployment Setup Summary" >> $GITHUB_STEP_SUMMARY
92+
echo "" >> $GITHUB_STEP_SUMMARY
93+
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
94+
echo "|-------|--------|" >> $GITHUB_STEP_SUMMARY
95+
echo "| **Job Status** | ${{ job.status == 'success' && '✅ Success' || '❌ Failed' }} |" >> $GITHUB_STEP_SUMMARY
96+
echo "| **Resource Group** | \`${{ inputs.RESOURCE_GROUP_NAME }}\` |" >> $GITHUB_STEP_SUMMARY
97+
98+
- name: Logout from Azure
99+
if: always()
100+
shell: bash
101+
run: |
102+
az logout || true
103+
echo "Logged out from Azure."

.github/workflows/tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ on:
1212
- '.github/workflows/tests.yml'
1313
pull_request:
1414
branches: [main, dev, demo]
15+
paths:
16+
- 'code/**'
17+
- 'pyproject.toml'
18+
- 'package.json'
19+
- 'pytest.ini'
20+
- '.github/workflows/tests.yml'
1521
types:
1622
- opened
1723
- ready_for_review
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Validate Bicep Parameters
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
schedule:
8+
- cron: '30 6 * * 3' # Wednesday 12:00 PM IST (6:30 AM UTC)
9+
pull_request:
10+
branches:
11+
- main
12+
- dev
13+
paths:
14+
- 'infra/**/*.bicep'
15+
- 'infra/**/*.parameters.json'
16+
- 'scripts/validate_bicep_params.py'
17+
workflow_dispatch:
18+
19+
env:
20+
accelerator_name: "CWYD"
21+
22+
jobs:
23+
validate:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout Code
27+
uses: actions/checkout@v4
28+
29+
- name: Set up Python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: '3.11'
33+
34+
- name: Validate infra/ parameters
35+
id: validate_infra
36+
continue-on-error: true
37+
run: |
38+
set +e
39+
python scripts/validate_bicep_params.py --dir infra --strict --no-color --json-output infra_results.json 2>&1 | tee infra_output.txt
40+
EXIT_CODE=${PIPESTATUS[0]}
41+
set -e
42+
echo "## Infra Param Validation" >> "$GITHUB_STEP_SUMMARY"
43+
echo '```' >> "$GITHUB_STEP_SUMMARY"
44+
cat infra_output.txt >> "$GITHUB_STEP_SUMMARY"
45+
echo '```' >> "$GITHUB_STEP_SUMMARY"
46+
exit $EXIT_CODE
47+
48+
- name: Set overall result
49+
id: result
50+
run: |
51+
if [[ "${{ steps.validate_infra.outcome }}" == "failure" ]]; then
52+
echo "status=failure" >> "$GITHUB_OUTPUT"
53+
else
54+
echo "status=success" >> "$GITHUB_OUTPUT"
55+
fi
56+
57+
- name: Upload validation results
58+
if: always()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: bicep-validation-results
62+
path: |
63+
infra_results.json
64+
retention-days: 30
65+
66+
- name: Send schedule notification on failure
67+
if: github.event_name == 'schedule' && steps.result.outputs.status == 'failure'
68+
env:
69+
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
70+
GITHUB_REPOSITORY: ${{ github.repository }}
71+
GITHUB_RUN_ID: ${{ github.run_id }}
72+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
73+
run: |
74+
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
75+
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
76+
77+
jq -n \
78+
--arg name "${ACCELERATOR_NAME}" \
79+
--arg infra "$INFRA_OUTPUT" \
80+
--arg url "$RUN_URL" \
81+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Issues Detected"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has detected parameter mapping errors.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Please fix the parameter mapping issues at your earliest convenience.</p><p>Best regards,<br>Your Automation Team</p>")}' \
82+
| curl -X POST "${LOGICAPP_URL}" \
83+
-H "Content-Type: application/json" \
84+
-d @- || echo "Failed to send notification"
85+
86+
- name: Send schedule notification on success
87+
if: github.event_name == 'schedule' && steps.result.outputs.status == 'success'
88+
env:
89+
LOGICAPP_URL: ${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}
90+
GITHUB_REPOSITORY: ${{ github.repository }}
91+
GITHUB_RUN_ID: ${{ github.run_id }}
92+
ACCELERATOR_NAME: ${{ env.accelerator_name }}
93+
run: |
94+
RUN_URL="https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
95+
INFRA_OUTPUT=$(sed 's/&/\&amp;/g; s/</\&lt;/g; s/>/\&gt;/g' infra_output.txt)
96+
97+
jq -n \
98+
--arg name "${ACCELERATOR_NAME}" \
99+
--arg infra "$INFRA_OUTPUT" \
100+
--arg url "$RUN_URL" \
101+
'{subject: ("Bicep Parameter Validation Report - " + $name + " - Passed"), body: ("<p>Dear Team,</p><p>The scheduled <strong>Bicep Parameter Validation</strong> for <strong>" + $name + "</strong> has completed successfully. All parameter mappings are valid.</p><p><strong>infra/ Results:</strong></p><pre>" + $infra + "</pre><p><strong>Run URL:</strong> <a href=\"" + $url + "\">" + $url + "</a></p><p>Best regards,<br>Your Automation Team</p>")}' \
102+
| curl -X POST "${LOGICAPP_URL}" \
103+
-H "Content-Type: application/json" \
104+
-d @- || echo "Failed to send notification"
105+
106+
- name: Fail if errors found
107+
if: steps.result.outputs.status == 'failure'
108+
run: exit 1

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,18 @@ Select either "PostgreSQL" or "Cosmos DB":
201201
![Solution Architecture - DB Selection](/docs/images/db_selection.png)
202202

203203

204-
When Deployment is complete, follow steps in [Set Up Authentication in Azure App Service](./docs/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
204+
**When Deployment is complete:**
205+
206+
1. Run the post-deployment setup script to configure the Function App client key and create PostgreSQL tables (if applicable). Open [Azure Cloud Shell](https://shell.azure.com) (Bash) and run:
207+
208+
```bash
209+
az login
210+
git clone https://github.com/Azure-Samples/chat-with-your-data-solution-accelerator.git
211+
cd chat-with-your-data-solution-accelerator
212+
bash scripts/post_deployment_setup.sh "<your-resource-group-name>"
213+
```
214+
215+
2. Follow steps in [Set Up Authentication in Azure App Service](./docs/azure_app_service_auth_setup.md) to add app authentication to your web app running on Azure App Service
205216

206217
**Note**: The default configuration deploys an OpenAI Model "gpt-4.1" with version 2025-04-14. However, not all
207218
locations support this version. If you're deploying to a location that doesn't support version 2024-05-13, you'll need to
@@ -266,7 +277,7 @@ Check out similar solution accelerators
266277
| [AI&nbsp;playbook](https://learn.microsoft.com/en-us/ai/playbook/) | The Artificial Intelligence (AI) Playbook provides enterprise software engineers with solutions, capabilities, and code developed to solve real-world AI problems. |
267278
| [Data&nbsp;playbook](https://learn.microsoft.com/en-us/data-engineering/playbook/understanding-data-playbook) | The data playbook provides enterprise software engineers with solutions which contain code developed to solve real-world problems. Everything in the playbook is developed with, and validated by, some of Microsoft's largest and most influential customers and partners. |
268279
269-
<br/>
280+
<br/>
270281
271282
### Resource links
272283

0 commit comments

Comments
 (0)