-
Notifications
You must be signed in to change notification settings - Fork 166
fix: merging dev to main #747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 29 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
4f36121
Remove OpenAI API call from app.py
NirajC-Microsoft 89b7912
resolve pylint issues in app.py
NirajC-Microsoft f033e81
update test_app.py file for init_openai method
NirajC-Microsoft 6887b78
update app.py to pass test file
NirajC-Microsoft 6189680
Fix for test file
NirajC-Microsoft c1325e8
disable soft delete
NirajC-Microsoft 20b125b
fetch upload/download data from block storage instead of data lake
NirajC-Microsoft ea2c82a
remove unnecessary flags
NirajC-Microsoft d2e4731
Remove OpenAI API call reference from chat_with_data_plugin.py file
NirajC-Microsoft e1176ce
Remove unuse imports
NirajC-Microsoft 5a71a5f
Update SampleQuestions.md with response time note (#736)
Thanusree-Microsoft 7910fed
remove openai from requirements.txt
NirajC-Microsoft 32d2ce4
updated test file
NirajC-Microsoft 797ea8b
fix: update API version to 2025-04-01 and adjust skuCapacity in main.…
Pavan-Microsoft 52e6cd6
fix: rename deploymentType parameter to gptModelDeploymentType for cl…
Pavan-Microsoft 3cddee5
fix: Re-query data after updating sample data to refresh rows (#739)
UtkarshMishra-Microsoft e38bdff
fix: clarify skuCapacity comment in main.bicep for WAF deployment
Pavan-Microsoft f09167f
fix: update skuCapacity configuration for WAF deployment to ensure co…
Pavan-Microsoft 9bd4885
Merge pull request #738 from microsoft/psl-pk-scaleinstance
Prajwal-Microsoft 4e14e12
Infra changes for OpenAI API call replacement
NirajC-Microsoft 185aa7b
refactor: Replace OpenAI API call with Foundry SDK
Avijit-Microsoft 5667d76
revert changes
NirajC-Microsoft bfe8a21
revert changes - 1
NirajC-Microsoft fc45156
add logic for both avm and bicep deployment
NirajC-Microsoft d7d7f6c
Merge pull request #734 from microsoft/psl-bug-25896
Prajwal-Microsoft 63d756d
feat: Enhance Developer Experience Support in Client Advisor (#735)
Kanchan-Microsoft 8c73dac
Add azure-ai-projects and azure-ai-inference to requirement.txt fine …
NirajC-Microsoft c10f3ba
Add azure-ai-projects and azure-ai-inference to requirement.txt fine …
NirajC-Microsoft ea5a2e5
fix: Add azure-ai-projects and azure-ai-inference to requirement.txt …
Avijit-Microsoft 5023139
Enable Key Vault while running post deployment script
NirajC-Microsoft 8d4298e
Merge pull request #749 from microsoft/psl-fixpostdeployment-script1
Prajwal-Microsoft 331bd04
fix: display previous meeting dates when asked “Provide details of la…
Rafi-Microsoft cb66abc
feat: Centralize SQL role assignment in run_create_index_scripts.sh a…
Abdul-Microsoft eabb739
Removed pre-requisite sqlcmd installation from Deployment Guide
Abdul-Microsoft 059dfa7
Merge pull request #753 from microsoft/psl-fdpobugfix
Prajwal-Microsoft ff09a28
feat: Add support for developer experience (#762)
Kanchan-Microsoft 040483c
resolved conflicts (#763)
Kanchan-Microsoft 6a0a6bb
Merge branch 'main' into dev
Kanchan-Microsoft f30300b
Merge branch 'dev' of https://github.com/microsoft/Build-your-own-cop…
Kanchan-Microsoft b0e4265
regenerated main.json
Kanchan-Microsoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,327 @@ | ||
| # yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json | ||
|
|
||
| name: build-your-own-copilot-solution-accelerator | ||
|
|
||
| requiredVersions: | ||
| azd: ">= 1.18.0" | ||
|
|
||
| metadata: | ||
| template: [email protected] | ||
| name: [email protected] | ||
|
|
||
| hooks: | ||
| # Pre-package hook to set container registry variables | ||
| prepackage: | ||
| windows: | ||
| run: | | ||
| Write-Host "Setting up container registry variables..." -ForegroundColor Green | ||
|
|
||
| # Get the ACR name from the deployed infrastructure | ||
| $acrName = azd env get-values --output json | ConvertFrom-Json | Select-Object -ExpandProperty "AZURE_CONTAINER_REGISTRY_NAME" -ErrorAction SilentlyContinue | ||
|
|
||
| if ($acrName) { | ||
| Write-Host "Using deployed ACR: $acrName" -ForegroundColor Cyan | ||
| azd env set AZURE_CONTAINER_REGISTRY_ENDPOINT "$acrName.azurecr.io" | ||
| azd env set AZURE_CONTAINER_REGISTRY_NAME $acrName | ||
| } else { | ||
| Write-Host "Warning: ACR not found in environment. Make sure infrastructure is deployed first." -ForegroundColor Yellow | ||
| } | ||
| shell: pwsh | ||
| continueOnError: true | ||
|
|
||
| posix: | ||
| run: | | ||
| echo "Setting up container registry variables..." | ||
|
|
||
| # Get the ACR name from the deployed infrastructure | ||
| ACR_NAME=$(azd env get-values --output json | jq -r '.AZURE_CONTAINER_REGISTRY_NAME // empty') | ||
|
|
||
| if [ ! -z "$ACR_NAME" ]; then | ||
| echo "Using deployed ACR: $ACR_NAME" | ||
| azd env set AZURE_CONTAINER_REGISTRY_ENDPOINT "$ACR_NAME.azurecr.io" | ||
| azd env set AZURE_CONTAINER_REGISTRY_NAME "$ACR_NAME" | ||
| else | ||
| echo "Warning: ACR not found in environment. Make sure infrastructure is deployed first." | ||
| fi | ||
| shell: sh | ||
| continueOnError: true | ||
|
|
||
| # Pre-deploy hook to build and push containers | ||
| predeploy: | ||
| windows: | ||
| run: | | ||
| Write-Host "🚀 Starting container deployment process..." -ForegroundColor Green | ||
|
|
||
| # Get environment variables from azd | ||
| $acrName = azd env get-value AZURE_CONTAINER_REGISTRY_NAME | ||
| $resourceGroup = azd env get-value AZURE_RESOURCE_GROUP | ||
| $webAppName = azd env get-value WEB_APP_NAME | ||
| $imageName = "byc-wa-app" | ||
| $imageTag = "latest" | ||
|
|
||
| if (-not $acrName) { | ||
| Write-Host "❌ Error: AZURE_CONTAINER_REGISTRY_NAME not set. Run 'azd provision' first." -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| if (-not $resourceGroup) { | ||
| Write-Host "❌ Error: AZURE_RESOURCE_GROUP not set. Run 'azd provision' first." -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| if (-not $webAppName) { | ||
| Write-Host "❌ Error: WEB_APP_NAME not set. Run 'azd provision' first." -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| Write-Host "📋 Configuration:" -ForegroundColor Cyan | ||
| Write-Host " ACR Name: $acrName" -ForegroundColor White | ||
| Write-Host " Resource Group: $resourceGroup" -ForegroundColor White | ||
| Write-Host " Web App: $webAppName" -ForegroundColor White | ||
| Write-Host " Image: $imageName`:$imageTag" -ForegroundColor White | ||
|
|
||
| # Login to ACR | ||
| Write-Host "🔐 Logging into ACR..." -ForegroundColor Yellow | ||
| az acr login --name $acrName | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "❌ Failed to login to ACR" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| # Build and push the container image | ||
| Write-Host "🏗️ Building container image..." -ForegroundColor Yellow | ||
| $fullImageName = "$acrName.azurecr.io/$imageName`:$imageTag" | ||
| docker build -f "./src/App/WebApp.Dockerfile" -t $fullImageName "./src" | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "❌ Failed to build container image" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| Write-Host "📤 Pushing container image to ACR..." -ForegroundColor Yellow | ||
| docker push $fullImageName | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "❌ Failed to push container image" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| # Update environment variables | ||
| Write-Host "🔧 Updating azd environment variables..." -ForegroundColor Yellow | ||
| azd env set CONTAINER_REGISTRY_HOSTNAME "$acrName.azurecr.io" | ||
| azd env set CONTAINER_IMAGE_NAME $imageName | ||
| azd env set IMAGE_TAG $imageTag | ||
|
|
||
| # Configure web app ACR authentication using managed identity | ||
| Write-Host "🔑 Configuring ACR authentication for web app..." -ForegroundColor Yellow | ||
| $webappIdentity = az webapp identity show --name $webAppName --resource-group $resourceGroup --query principalId --output tsv | ||
|
|
||
| if (-not $webappIdentity -or $webappIdentity -eq "null") { | ||
| Write-Host "🔄 Enabling managed identity for web app..." -ForegroundColor Yellow | ||
| $webappIdentity = az webapp identity assign --name $webAppName --resource-group $resourceGroup --query principalId --output tsv | ||
| } | ||
|
|
||
| Write-Host " Web app identity: $webappIdentity" -ForegroundColor White | ||
|
|
||
| # Assign AcrPull role to web app managed identity | ||
| Write-Host "🔐 Assigning AcrPull role to web app..." -ForegroundColor Yellow | ||
| $acrResourceId = az acr show --name $acrName --resource-group $resourceGroup --query id --output tsv | ||
| az role assignment create --assignee $webappIdentity --role AcrPull --scope $acrResourceId | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "⚠️ Role assignment may already exist" -ForegroundColor Yellow | ||
| } | ||
|
|
||
| # Configure web app to use ACR with managed identity | ||
| Write-Host "🔧 Configuring web app container settings..." -ForegroundColor Yellow | ||
| az webapp config appsettings set --name $webAppName --resource-group $resourceGroup --settings ` | ||
| DOCKER_REGISTRY_SERVER_URL="https://$acrName.azurecr.io" ` | ||
| DOCKER_ENABLE_CI=true | ||
|
|
||
| # Configure web app to use managed identity for ACR authentication | ||
| Write-Host "🔐 Enabling ACR managed identity authentication..." -ForegroundColor Yellow | ||
| az webapp config set --name $webAppName --resource-group $resourceGroup --acr-use-identity true | ||
|
|
||
| # Update web app to use the new container image | ||
| Write-Host "🚀 Updating web app container image..." -ForegroundColor Yellow | ||
| $dockerImage = "DOCKER|$fullImageName" | ||
|
|
||
| # Use cmd to avoid PowerShell pipe interpretation issues | ||
| $cmd = "az webapp config set --name `"$webAppName`" --resource-group `"$resourceGroup`" --linux-fx-version `"$dockerImage`"" | ||
| cmd /c $cmd | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "❌ Failed to update web app configuration" -ForegroundColor Red | ||
| exit 1 | ||
| } | ||
|
|
||
| # Restart the web app to ensure it picks up the new configuration | ||
| Write-Host "🔄 Restarting web app..." -ForegroundColor Yellow | ||
| az webapp restart --name $webAppName --resource-group $resourceGroup | ||
|
|
||
| Write-Host "✅ Container deployment completed successfully!" -ForegroundColor Green | ||
| Write-Host "🌐 Web app URL: https://$webAppName.azurewebsites.net" -ForegroundColor Cyan | ||
| Write-Host "📦 Container image: $fullImageName" -ForegroundColor Cyan | ||
|
|
||
| Write-Host "" | ||
| Write-Host "⏳ The web app may take a few minutes to start up with the new container..." -ForegroundColor Yellow | ||
| Write-Host " You can monitor the logs with:" -ForegroundColor White | ||
| Write-Host " az webapp log tail --name $webAppName --resource-group $resourceGroup" -ForegroundColor Cyan | ||
| shell: pwsh | ||
| continueOnError: false | ||
|
|
||
| posix: | ||
| run: | | ||
| echo "🚀 Starting container deployment process..." | ||
|
|
||
| # Get environment variables from azd | ||
| ACR_NAME=$(azd env get-value AZURE_CONTAINER_REGISTRY_NAME) | ||
| RESOURCE_GROUP=$(azd env get-value AZURE_RESOURCE_GROUP) | ||
| WEB_APP_NAME=$(azd env get-value WEB_APP_NAME) | ||
| IMAGE_TAG="latest" | ||
| IMAGE_NAME="byc-wa-app" | ||
|
|
||
| if [ -z "$ACR_NAME" ]; then | ||
| echo "❌ Error: AZURE_CONTAINER_REGISTRY_NAME not set. Run 'azd provision' first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "$RESOURCE_GROUP" ]; then | ||
| echo "❌ Error: AZURE_RESOURCE_GROUP not set. Run 'azd provision' first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -z "$WEB_APP_NAME" ]; then | ||
| echo "❌ Error: WEB_APP_NAME not set. Run 'azd provision' first." | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "📋 Configuration:" | ||
| echo " ACR Name: $ACR_NAME" | ||
| echo " Resource Group: $RESOURCE_GROUP" | ||
| echo " Web App: $WEB_APP_NAME" | ||
| echo " Image: $IMAGE_NAME:$IMAGE_TAG" | ||
|
|
||
| # Login to ACR | ||
| echo "🔐 Logging into ACR..." | ||
| az acr login --name $ACR_NAME | ||
|
|
||
| # Build and push the container image | ||
| echo "🏗️ Building container image..." | ||
| FULL_IMAGE_NAME="$ACR_NAME.azurecr.io/$IMAGE_NAME:$IMAGE_TAG" | ||
| docker build -f "./src/App/WebApp.Dockerfile" -t $FULL_IMAGE_NAME "./src" | ||
|
|
||
| echo "📤 Pushing container image to ACR..." | ||
| docker push $FULL_IMAGE_NAME | ||
|
|
||
| # Update environment variables | ||
| echo "🔧 Updating azd environment variables..." | ||
| azd env set CONTAINER_REGISTRY_HOSTNAME "$ACR_NAME.azurecr.io" | ||
| azd env set CONTAINER_IMAGE_NAME $IMAGE_NAME | ||
| azd env set IMAGE_TAG $IMAGE_TAG | ||
|
|
||
| # Configure web app ACR authentication using managed identity | ||
| echo "🔑 Configuring ACR authentication for web app..." | ||
| WEBAPP_IDENTITY=$(az webapp identity show --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP --query principalId --output tsv) | ||
|
|
||
| if [ -z "$WEBAPP_IDENTITY" ] || [ "$WEBAPP_IDENTITY" = "null" ]; then | ||
| echo "🔄 Enabling managed identity for web app..." | ||
| WEBAPP_IDENTITY=$(az webapp identity assign --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP --query principalId --output tsv) | ||
| fi | ||
|
|
||
| echo " Web app identity: $WEBAPP_IDENTITY" | ||
|
|
||
| # Assign AcrPull role to web app managed identity | ||
| echo "🔐 Assigning AcrPull role to web app..." | ||
| ACR_RESOURCE_ID=$(az acr show --name $ACR_NAME --resource-group $RESOURCE_GROUP --query id --output tsv) | ||
| az role assignment create --assignee $WEBAPP_IDENTITY --role AcrPull --scope $ACR_RESOURCE_ID || echo "⚠️ Role assignment may already exist" | ||
|
|
||
| # Configure web app to use ACR with managed identity | ||
| echo "🔧 Configuring web app container settings..." | ||
| az webapp config appsettings set --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP --settings \ | ||
| DOCKER_REGISTRY_SERVER_URL="https://$ACR_NAME.azurecr.io" \ | ||
| DOCKER_ENABLE_CI=true | ||
|
|
||
| # Configure web app to use managed identity for ACR authentication | ||
| echo "🔐 Enabling ACR managed identity authentication..." | ||
| az webapp config set --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP --acr-use-identity true | ||
|
|
||
| # Update web app to use the new container image | ||
| echo "🚀 Updating web app container image..." | ||
| DOCKER_IMAGE="DOCKER|$FULL_IMAGE_NAME" | ||
| az webapp config set --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP --linux-fx-version "$DOCKER_IMAGE" | ||
|
|
||
| # Restart the web app to ensure it picks up the new configuration | ||
| echo "🔄 Restarting web app..." | ||
| az webapp restart --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP | ||
|
|
||
| echo "✅ Container deployment completed successfully!" | ||
| echo "🌐 Web app URL: https://$WEB_APP_NAME.azurewebsites.net" | ||
| echo "📦 Container image: $FULL_IMAGE_NAME" | ||
|
|
||
| echo "" | ||
| echo "⏳ The web app may take a few minutes to start up with the new container..." | ||
| echo " You can monitor the logs with:" | ||
| echo " az webapp log tail --name $WEB_APP_NAME --resource-group $RESOURCE_GROUP" | ||
| shell: sh | ||
| continueOnError: false | ||
|
|
||
| postprovision: | ||
| windows: | ||
| run: | | ||
| Write-Host "Deployment completed successfully!" -ForegroundColor Green | ||
| Write-Host "Web app URL: " -NoNewline | ||
| Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| Write-Host "Container Registry: " -NoNewline | ||
| Write-Host "$env:AZURE_CONTAINER_REGISTRY_NAME.azurecr.io" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| Write-Host "Next step:" -ForegroundColor Yellow | ||
| Write-Host " Run the following command to grant permissions and load sample data:" -ForegroundColor White | ||
| Write-Host " bash ./infra/scripts/process_sample_data.sh $env:AZURE_RESOURCE_GROUP" -ForegroundColor Cyan | ||
| Write-Host "" | ||
| shell: pwsh | ||
| continueOnError: false | ||
| interactive: true | ||
|
|
||
| posix: | ||
| run: | | ||
| echo "Deployment completed successfully!" | ||
| echo "Web app URL: $WEB_APP_URL" | ||
| echo "" | ||
| echo "Container Registry: $AZURE_CONTAINER_REGISTRY_NAME.azurecr.io" | ||
| echo "" | ||
| echo "Next step:" | ||
| echo " Run the following command to grant permissions and load sample data:" | ||
| echo " bash ./infra/scripts/process_sample_data.sh $AZURE_RESOURCE_GROUP" | ||
| echo "" | ||
| shell: sh | ||
| continueOnError: false | ||
| interactive: true | ||
|
|
||
| postdeploy: | ||
| windows: | ||
| run: | | ||
| Write-Host "✅ Deployment completed! Container deployment was handled by predeploy hook." -ForegroundColor Green | ||
| $webAppUrl = azd env get-value WEB_APP_URL | ||
| Write-Host "🌐 Web app URL: $webAppUrl" -ForegroundColor Cyan | ||
| shell: pwsh | ||
| continueOnError: true | ||
|
|
||
| posix: | ||
| run: | | ||
| echo "✅ Deployment completed! Container deployment was handled by predeploy hook." | ||
| WEB_APP_URL=$(azd env get-value WEB_APP_URL) | ||
| echo "🌐 Web app URL: $WEB_APP_URL" | ||
| shell: sh | ||
| continueOnError: true | ||
|
|
||
| # Infrastructure configuration | ||
| infra: | ||
| provider: bicep | ||
| path: infra | ||
| module: main | ||
| parameters: | ||
| containerRegistryHostname: ${CONTAINER_REGISTRY_HOSTNAME=""} | ||
| containerImageName: ${CONTAINER_IMAGE_NAME="byc-wa-app"} | ||
| imageTag: ${IMAGE_TAG="latest"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.