From 536d6c612171f7640bff186214282a2e701a097c Mon Sep 17 00:00:00 2001 From: "Niraj Chaudhari (Persistent Systems Inc)" Date: Thu, 9 Oct 2025 20:21:04 +0530 Subject: [PATCH 1/3] script fix --- azure.yaml | 4 ++-- docs/AVMPostDeploymentGuide.md | 2 +- infra/main.bicep | 2 ++ infra/scripts/process_sample_data.sh | 18 ++++++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/azure.yaml b/azure.yaml index f8a7f360..c9bcc1d3 100644 --- a/azure.yaml +++ b/azure.yaml @@ -16,7 +16,7 @@ hooks: Write-Host "Web app URL: " Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan Write-Host "`nRun the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application." - Write-Host "bash ./infra/scripts/process_sample_data.sh" -ForegroundColor Cyan + Write-Host "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP_NAME" -ForegroundColor Cyan shell: pwsh continueOnError: false interactive: true @@ -26,7 +26,7 @@ hooks: echo $WEB_APP_URL echo "" echo "Run the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application." - echo "bash ./infra/scripts/process_sample_data.sh" + echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP_NAME" shell: sh continueOnError: false interactive: true diff --git a/docs/AVMPostDeploymentGuide.md b/docs/AVMPostDeploymentGuide.md index 0ba7a63b..3fb0dc79 100644 --- a/docs/AVMPostDeploymentGuide.md +++ b/docs/AVMPostDeploymentGuide.md @@ -14,7 +14,7 @@ This document provides guidance on post-deployment steps after deploying the Bui 2. Import Sample Data -Run bash command printed in the terminal. The bash command will look like the following: ```bash - ./infra/scripts/process_sample_data.sh + bash ./infra/scripts/process_sample_data.sh ``` If the deployment does not exist or has been deleted – The script will prompt you to manually enter the required values diff --git a/infra/main.bicep b/infra/main.bicep index aab96329..061f55d8 100644 --- a/infra/main.bicep +++ b/infra/main.bicep @@ -1382,3 +1382,5 @@ output USE_AI_PROJECT_CLIENT string = useAIProjectClientFlag @description('Indicates whether the internal stream should be used.') output USE_INTERNAL_STREAM string = useInternalStream +@description('The Azure Subscription ID where the resources are deployed.') +output AZURE_SUBSCRIPTION_ID string = subscription().subscriptionId diff --git a/infra/scripts/process_sample_data.sh b/infra/scripts/process_sample_data.sh index 546da9e7..7711e4ec 100644 --- a/infra/scripts/process_sample_data.sh +++ b/infra/scripts/process_sample_data.sh @@ -330,6 +330,24 @@ if az deployment group show --resource-group "$resourceGroupName" --name "$deplo --query "properties.outputs.managedidentitY_WEBAPP_NAME.value" -o tsv) echo "Web App Managed Identity Display Name (from outputs): $webAppManagedIdentityDisplayName" + SqlDatabaseName=$(az deployment group show \ + --name "$deploymentName" \ + --resource-group "$resourceGroupName" \ + --query "properties.outputs.sqldB_DATABASE.value" -o tsv) + echo "SQL Database Name (from outputs): $SqlDatabaseName" + + sqlManagedIdentityClientId=$(az deployment group show \ + --name "$deploymentName" \ + --resource-group "$resourceGroupName" \ + --query "properties.outputs.managedidentitY_SQL_CLIENTID.value" -o tsv) + echo "SQL Managed Identity Client ID (from outputs): $sqlManagedIdentityClientId" + + sqlManagedIdentityDisplayName=$(az deployment group show \ + --name "$deploymentName" \ + --resource-group "$resourceGroupName" \ + --query "properties.outputs.managedidentitY_SQL_NAME.value" -o tsv) + echo "SQL Managed Identity Display Name (from outputs): $sqlManagedIdentityDisplayName" + aiSearchName=$(az deployment group show \ --name "$deploymentName" \ --resource-group "$resourceGroupName" \ From 568181aefa58956c1342442aa04fd3240eb70507 Mon Sep 17 00:00:00 2001 From: "Niraj Chaudhari (Persistent Systems Inc)" Date: Thu, 9 Oct 2025 21:27:22 +0530 Subject: [PATCH 2/3] update azure.yml --- azure.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure.yaml b/azure.yaml index c9bcc1d3..4c3ca3b0 100644 --- a/azure.yaml +++ b/azure.yaml @@ -16,7 +16,7 @@ hooks: Write-Host "Web app URL: " Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan Write-Host "`nRun the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application." - Write-Host "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP_NAME" -ForegroundColor Cyan + Write-Host "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" -ForegroundColor Cyan shell: pwsh continueOnError: false interactive: true @@ -26,7 +26,7 @@ hooks: echo $WEB_APP_URL echo "" echo "Run the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application." - echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP_NAME" + echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" shell: sh continueOnError: false interactive: true From 090534e1bbb589439c4580823c7c4137a36027a6 Mon Sep 17 00:00:00 2001 From: "Niraj Chaudhari (Persistent Systems Inc)" Date: Thu, 9 Oct 2025 21:53:48 +0530 Subject: [PATCH 3/3] fix script 1 --- infra/scripts/process_sample_data.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/infra/scripts/process_sample_data.sh b/infra/scripts/process_sample_data.sh index 7711e4ec..4f055ea7 100644 --- a/infra/scripts/process_sample_data.sh +++ b/infra/scripts/process_sample_data.sh @@ -330,6 +330,12 @@ if az deployment group show --resource-group "$resourceGroupName" --name "$deplo --query "properties.outputs.managedidentitY_WEBAPP_NAME.value" -o tsv) echo "Web App Managed Identity Display Name (from outputs): $webAppManagedIdentityDisplayName" + webAppManagedIdentityClientId=$(az deployment group show \ + --name "$deploymentName" \ + --resource-group "$resourceGroupName" \ + --query "properties.outputs.managedidentitY_WEBAPP_CLIENTID.value" -o tsv) + echo "Web App Managed Identity Client ID (from outputs): $webAppManagedIdentityClientId" + SqlDatabaseName=$(az deployment group show \ --name "$deploymentName" \ --resource-group "$resourceGroupName" \ @@ -378,6 +384,8 @@ else read -rp "Enter Key Vault Name: " keyvaultName read -rp "Enter Web App Managed Identity Display Name: " webAppManagedIdentityDisplayName read -rp "Enter Web App Managed Identity Client ID: " webAppManagedIdentityClientId + read -rp "Enter SQL Managed Identity Display Name: " sqlManagedIdentityDisplayName + read -rp "Enter SQL Managed Identity Client ID: " sqlManagedIdentityClientId read -rp "Enter AI Search Service Name: " aiSearchName read -rp "Enter AI Foundry Resource ID: " aif_resource_id read -rp "Enter Azure Subscription ID: " azSubscriptionId