Skip to content

Commit 3e98559

Browse files
AjitPadhi-MicrosoftRoopan-MicrosoftPavan-Microsoftross-p-smithgpickett
authored
chore: Dev to Main (#2243)
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: Roopan P M <v-roopanpm@microsoft.com> Co-authored-by: Roopan-Microsoft <168007406+Roopan-Microsoft@users.noreply.github.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> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Ritesh-Microsoft <v-riteshmate@microsoft.com> Co-authored-by: chaudhariniraj <70953410+chaudhariniraj@users.noreply.github.com> Co-authored-by: AbdulMujeeb-2000 <74786844+AbdulMujeeb-2000@users.noreply.github.com>
1 parent 5c99c24 commit 3e98559

8 files changed

Lines changed: 78 additions & 17 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: AZD Template Validation
2+
on:
3+
schedule:
4+
- cron: '30 1 * * 4' # Every Thursday at 7:00 AM IST (1:30 AM UTC)
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- 'infra/**'
11+
- 'azure.yaml'
12+
- 'scripts/**'
13+
- '.github/workflows/azd-template-validation.yml'
14+
15+
pull_request:
16+
branches:
17+
- dev
18+
19+
permissions:
20+
contents: read
21+
id-token: write
22+
pull-requests: write
23+
24+
jobs:
25+
template_validation:
26+
runs-on: ubuntu-latest
27+
environment: production
28+
name: azd template validation
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- uses: microsoft/template-validation-action@Latest
33+
with:
34+
validateAzd: ${{ vars.TEMPLATE_VALIDATE_AZD }}
35+
useDevContainer: ${{ vars.TEMPLATE_USE_DEV_CONTAINER }}
36+
id: validation
37+
env:
38+
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
39+
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
40+
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
41+
AZURE_ENV_NAME: ${{ vars.AZURE_ENV_NAME }}
42+
AZURE_LOCATION: ${{ vars.AZURE_LOCATION }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
TEMP: /tmp
45+
AZURE_PRINCIPAL_ID: ${{ secrets.PRINCIPAL_ID || secrets.AZURE_CLIENT_ID }}
46+
AZURE_PRINCIPAL_TYPE: 'ServicePrincipal'
47+
- name: print result
48+
run: cat ${{ steps.validation.outputs.resultFile }}

code/app.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
for logger_name in AZURE_LOGGING_PACKAGES:
2929
logging.getLogger(logger_name).setLevel(azure_package_log_level)
3030

31-
# We cannot use EnvHelper here as Application Insights should be configured first
32-
# for instrumentation to work correctly
31+
# We cannot use EnvHelper here as Application Insights should be configured first for instrumentation to work correctly
3332
if os.getenv("APPLICATIONINSIGHTS_ENABLED", "false").lower() == "true":
3433
configure_azure_monitor()
3534
HTTPXClientInstrumentor().instrument() # httpx is used by openai

docs/LOCAL_DEPLOYMENT.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ Select one of the following options to set up your Chat with your Data local dep
129129
- [Python 3.11](https://www.python.org/downloads/release/python-3119/)
130130
- [Node.js LTS](https://nodejs.org/en)
131131
- [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd) <small>(v1.18.0+)</small>
132+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) <small>(v2.87.0+ required for post-deployment scripts)</small>
132133
- [Bicep CLI](https://learn.microsoft.com/azure/azure-resource-manager/bicep/install) <small>(v0.33.0+)</small>
133134
- [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local)
134135
- [Git](https://git-scm.com/downloads)
@@ -309,6 +310,18 @@ az login
309310
az login --tenant-id <tenant-id>
310311
```
311312
313+
> **Important:** The post-deployment script requires **Azure CLI version 2.87.0 or later**.
314+
>
315+
> Check your installed version:
316+
> ```bash
317+
> az version
318+
> ```
319+
>
320+
> If your version is earlier than **2.87.0**, upgrade Azure CLI before running the script:
321+
> ```bash
322+
> az upgrade
323+
> ```
324+
312325
**PowerShell (Windows):**
313326
```powershell
314327
./scripts/post_deployment_setup.ps1 -ResourceGroupName "<your-resource-group-name>"

docs/NON_DEVCONTAINER_SETUP.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ If you are unable to run this accelerator using a DevContainer or in GitHub Code
1414
- [Python 3.11](https://www.python.org/downloads/release/python-3119/)
1515
- [Node.js LTS](https://nodejs.org/en)
1616
- [Azure Developer CLI](https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd) <small>(v1.18.0+)</small>
17+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) <small>(v2.87.0+ required for post-deployment scripts)</small>
1718
- [Bicep CLI](https://learn.microsoft.com/azure/azure-resource-manager/bicep/install) <small>(v0.33.0+)</small>
1819
- [Azure Functions Core Tools](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local)
1920

infra/main.bicep

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,15 +1013,15 @@ module keyvault './modules/key-vault/vault/vault.bicep' = {
10131013
{
10141014
principalId: managedIdentityModule.outputs.principalId
10151015
principalType: 'ServicePrincipal'
1016-
roleDefinitionIdOrName: 'Key Vault Secrets User'
1016+
roleDefinitionIdOrName: '4633458b-17de-408a-b874-0445c86b69e6' // Key Vault Secrets User
10171017
}
10181018
]
10191019
: [],
10201020
!empty(principal.id)
10211021
? [
10221022
{
10231023
principalId: principal.id
1024-
roleDefinitionIdOrName: 'Key Vault Secrets User'
1024+
roleDefinitionIdOrName: '4633458b-17de-408a-b874-0445c86b69e' // Key Vault Secrets User
10251025
}
10261026
]
10271027
: []
@@ -1812,7 +1812,7 @@ module storage './modules/storage/storage-account/storage-account.bicep' = {
18121812
}
18131813
{
18141814
principalId: managedIdentityModule.outputs.principalId
1815-
roleDefinitionIdOrName: 'Storage File Data Privileged Contributor'
1815+
roleDefinitionIdOrName: '69566ab7-960f-475b-8e7c-b3118f30c6bd' // Storage File Data Privileged Contributor
18161816
principalType: 'ServicePrincipal'
18171817
}
18181818
]

infra/main.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.43.8.12551",
9-
"templateHash": "8257042867279369414"
9+
"templateHash": "9642437726761388509"
1010
}
1111
},
1212
"parameters": {
@@ -21540,7 +21540,7 @@
2154021540
"diagnosticSettings": "[if(parameters('enableMonitoring'), createObject('value', createArray(createObject('workspaceResourceId', reference('monitoring').outputs.logAnalyticsWorkspaceId.value))), createObject('value', null()))]",
2154121541
"privateEndpoints": "[if(parameters('enablePrivateNetworking'), createObject('value', createArray(createObject('name', format('pep-{0}', variables('keyVaultName')), 'customNetworkInterfaceName', format('nic-{0}', variables('keyVaultName')), 'privateDnsZoneGroup', createObject('privateDnsZoneGroupConfigs', createArray(createObject('privateDnsZoneResourceId', reference(format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').keyVault)).outputs.resourceId.value))), 'service', 'vault', 'subnetResourceId', reference('virtualNetwork').outputs.pepsSubnetResourceId.value))), createObject('value', createArray()))]",
2154221542
"roleAssignments": {
21543-
"value": "[concat(if(not(equals(reference('managedIdentityModule').outputs.principalId.value, '')), createArray(createObject('principalId', reference('managedIdentityModule').outputs.principalId.value, 'principalType', 'ServicePrincipal', 'roleDefinitionIdOrName', 'Key Vault Secrets User')), createArray()), if(not(empty(parameters('principal').id)), createArray(createObject('principalId', parameters('principal').id, 'roleDefinitionIdOrName', 'Key Vault Secrets User')), createArray()))]"
21543+
"value": "[concat(if(not(equals(reference('managedIdentityModule').outputs.principalId.value, '')), createArray(createObject('principalId', reference('managedIdentityModule').outputs.principalId.value, 'principalType', 'ServicePrincipal', 'roleDefinitionIdOrName', '4633458b-17de-408a-b874-0445c86b69e6')), createArray()), if(not(empty(parameters('principal').id)), createArray(createObject('principalId', parameters('principal').id, 'roleDefinitionIdOrName', '4633458b-17de-408a-b874-0445c86b69e')), createArray()))]"
2154421544
},
2154521545
"secrets": {
2154621546
"value": [
@@ -52724,7 +52724,7 @@
5272452724
},
5272552725
{
5272652726
"principalId": "[reference('managedIdentityModule').outputs.principalId.value]",
52727-
"roleDefinitionIdOrName": "Storage File Data Privileged Contributor",
52727+
"roleDefinitionIdOrName": "69566ab7-960f-475b-8e7c-b3118f30c6bd",
5272852728
"principalType": "ServicePrincipal"
5272952729
}
5273052730
]
@@ -55924,9 +55924,9 @@
5592455924
}
5592555925
},
5592655926
"dependsOn": [
55927+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
5592755928
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
5592855929
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
55929-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageQueue)]",
5593055930
"managedIdentityModule",
5593155931
"virtualNetwork"
5593255932
]

scripts/post_deployment_setup.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ else {
264264
Write-Host "✓ Adding temporary firewall rule for IP $publicIp..."
265265
az postgres flexible-server firewall-rule create `
266266
--resource-group $ResourceGroupName `
267-
--name $serverName `
268-
--rule-name "AllowPostDeploySetup" `
267+
--server-name $serverName `
268+
--name "AllowPostDeploySetup" `
269269
--start-ip-address $publicIp `
270270
--end-ip-address $publicIp 2>$null | Out-Null
271271

@@ -353,8 +353,8 @@ else {
353353
Write-Host "✓ Removing temporary firewall rule..."
354354
az postgres flexible-server firewall-rule delete `
355355
--resource-group $ResourceGroupName `
356-
--name $serverName `
357-
--rule-name "AllowPostDeploySetup" `
356+
--server-name $serverName `
357+
--name "AllowPostDeploySetup" `
358358
--yes 2>$null
359359
}
360360

scripts/post_deployment_setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ cleanup() {
108108
echo "✓ Removing temporary firewall rule..."
109109
az postgres flexible-server firewall-rule delete \
110110
--resource-group "$RESOURCE_GROUP" \
111-
--name "$SERVER_NAME" \
112-
--rule-name "AllowPostDeploySetup" \
111+
--server-name "$SERVER_NAME" \
112+
--name "AllowPostDeploySetup" \
113113
--yes 2>/dev/null || true
114114
fi
115115
restore_network_access
@@ -329,8 +329,8 @@ else
329329
echo "✓ Adding temporary firewall rule for IP ${PUBLIC_IP}..."
330330
az postgres flexible-server firewall-rule create \
331331
--resource-group "$RESOURCE_GROUP" \
332-
--name "$SERVER_NAME" \
333-
--rule-name "AllowPostDeploySetup" \
332+
--server-name "$SERVER_NAME" \
333+
--name "AllowPostDeploySetup" \
334334
--start-ip-address "$PUBLIC_IP" \
335335
--end-ip-address "$PUBLIC_IP" > /dev/null 2>&1
336336

0 commit comments

Comments
 (0)