diff --git a/azure.yaml b/azure.yaml index f8a7f360..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" -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" + echo "bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" 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..4f055ea7 100644 --- a/infra/scripts/process_sample_data.sh +++ b/infra/scripts/process_sample_data.sh @@ -330,6 +330,30 @@ 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" \ + --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" \ @@ -360,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