feat: Improve Developer Experience#973
Open
Abdul-Microsoft wants to merge 13 commits into
Open
Conversation
- setup_local_dev.sh/.ps1: Automates full local development setup - Prerequisite checks with detailed install guidance - Azure config fetch from Resource Group (container app or individual resources) - RBAC role assignment with pre-check (Cosmos DB, AI Foundry, Search, Storage) - Virtual environment setup for backend, MCP server, and frontend - VS Code settings and launch.json generation - Auto-fix for .venv lock issues (VS Code Python extension) - deploy_to_azure.sh/.ps1: Deploys local code changes to Azure - Builds Docker images for selected services (backend, mcp, frontend) - Pushes to ACR with unique timestamp+git-sha tags - Updates Container Apps and App Service with new images - ACR discovery, creation, and AcrPull role assignment - Dry-run mode, build-only/deploy-only modes - Rollback commands printed after deployment - .gitignore: Added local dev artifacts (.macae_*.pid, start_all_services.sh) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…signment, and change detection
…Linux/macOS and Windows
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds cross-platform automation for setting up a local development environment and deploying local code changes to Azure, along with new documentation describing both workflows.
Changes:
- Add
setup_local_dev.sh/setup_local_dev.ps1to automate local environment setup (Azure auth,.envgeneration, dependency install, RBAC, VS Code config). - Add
deploy_to_azure.sh/deploy_to_azure.ps1to build/push only changed services and update Azure resources. - Add new docs for both workflows and update
.gitignorefor local artifacts.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 20 comments.
Show a summary per file
| File | Description |
|---|---|
| setup_local_dev.sh | Bash-based local setup automation (config discovery, env generation, RBAC, installs, VS Code config). |
| setup_local_dev.ps1 | PowerShell-based local setup automation with similar workflow on Windows. |
| deploy_to_azure.sh | Bash deployment helper for building/pushing images and updating Azure resources. |
| deploy_to_azure.ps1 | PowerShell deployment helper mirroring the bash script. |
| docs/AutomatedLocalSetup.md | New documentation for automated local setup scripts. |
| docs/DeployLocalChanges.md | New documentation for deploying local changes scripts. |
| .gitignore | Ignore additional local dev artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Remove local dev setup artifacts from .gitignore
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Fix Write-LogWarn crash from extra -ForegroundColor parameter (deploy_to_azure.ps1) - Fix misleading git diff warning message in both deploy scripts - Change -r to -g short flag for --resource-group to match docs (setup_local_dev.sh) - Gate RBAC assignment behind --assign-rbac / -AssignRbac flag (both setup scripts) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
RBAC roles are essential for local dev and should always be assigned. The script already skips roles that are already assigned, so running unconditionally is safe and simplifies the user experience. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Moved all 4 scripts to scripts/ directory and updated all references in docs/AutomatedLocalSetup.md and docs/DeployLocalChanges.md. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Scripts now compute REPO_ROOT as two levels up from their location in infra/scripts/, so all src/ and .azure/ paths resolve correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment on lines
+163
to
+173
| if command -v docker &>/dev/null; then | ||
| log_success "Docker found: $(docker --version)" | ||
| else | ||
| missing+=("docker") | ||
| fi | ||
|
|
||
| if command -v az &>/dev/null; then | ||
| log_success "Azure CLI found" | ||
| else | ||
| missing+=("azure-cli") | ||
| fi |
| log_warn "No service-specific changes detected (no uncommitted changes vs HEAD)." | ||
| echo "" | ||
| read -rp "No changes detected. Deploy all services anyway? [y/N]: " confirm | ||
| if [[ "${confirm,,}" == "y" || "${confirm,,}" == "yes" ]]; then |
Comment on lines
+511
to
+516
| log_info "Generating .env file at: $env_file" | ||
|
|
||
| declare -A env_vars | ||
| while IFS= read -r line; do | ||
| line="${line%%$'\r'}" | ||
| [[ -z "$line" || "$line" == \#* ]] && continue |
| AZURE_OPENAI_RAI_DEPLOYMENT_NAME=${env_vars[AZURE_OPENAI_RAI_DEPLOYMENT_NAME]:-gpt-4.1} | ||
| AZURE_OPENAI_API_VERSION=${env_vars[AZURE_OPENAI_API_VERSION]:-2024-12-01-preview} | ||
| REASONING_MODEL_NAME=${env_vars[REASONING_MODEL_NAME]:-o4-mini} | ||
| SUPPORTED_MODELS=${env_vars[SUPPORTED_MODELS]:-["o3","o4-mini","gpt-4.1","gpt-4.1-mini"]} |
Comment on lines
+875
to
+883
| cat > "$settings_file" << 'SETEOF' | ||
| { | ||
| "python.defaultInterpreterPath": "${workspaceFolder}/src/backend/.venv/Scripts/python.exe", | ||
| "python.terminal.activateEnvironment": true, | ||
| "python.linting.enabled": true, | ||
| "python.formatting.provider": "black", | ||
| "python.debugging.logLevel": "Debug", | ||
| "debug.inlineValues": "on", | ||
| "files.exclude": { |
Comment on lines
+479
to
+501
| COSMOSDB_ENDPOINT=$($envVars["COSMOSDB_ENDPOINT"]) | ||
| COSMOSDB_DATABASE=$($envVars["COSMOSDB_DATABASE"] ?? "macae") | ||
| COSMOSDB_CONTAINER=$($envVars["COSMOSDB_CONTAINER"] ?? "memory") | ||
|
|
||
| # --- Azure OpenAI --- | ||
| AZURE_OPENAI_ENDPOINT=$($envVars["AZURE_OPENAI_ENDPOINT"]) | ||
| AZURE_OPENAI_MODEL_NAME=$($envVars["AZURE_OPENAI_MODEL_NAME"] ?? "gpt-4.1-mini") | ||
| AZURE_OPENAI_DEPLOYMENT_NAME=$($envVars["AZURE_OPENAI_DEPLOYMENT_NAME"] ?? "gpt-4.1-mini") | ||
| AZURE_OPENAI_RAI_DEPLOYMENT_NAME=$($envVars["AZURE_OPENAI_RAI_DEPLOYMENT_NAME"] ?? "gpt-4.1") | ||
| AZURE_OPENAI_API_VERSION=$($envVars["AZURE_OPENAI_API_VERSION"] ?? "2024-12-01-preview") | ||
| REASONING_MODEL_NAME=$($envVars["REASONING_MODEL_NAME"] ?? "o4-mini") | ||
| SUPPORTED_MODELS=$($envVars["SUPPORTED_MODELS"] ?? '["o3","o4-mini","gpt-4.1","gpt-4.1-mini"]') | ||
|
|
||
| # --- Azure AI Foundry --- | ||
| AZURE_AI_SUBSCRIPTION_ID=$($envVars["AZURE_AI_SUBSCRIPTION_ID"]) | ||
| AZURE_AI_RESOURCE_GROUP=$($envVars["AZURE_AI_RESOURCE_GROUP"]) | ||
| AZURE_AI_PROJECT_NAME=$($envVars["AZURE_AI_PROJECT_NAME"]) | ||
| AZURE_AI_PROJECT_ENDPOINT=$($envVars["AZURE_AI_PROJECT_ENDPOINT"]) | ||
| AZURE_AI_AGENT_ENDPOINT=$($envVars["AZURE_AI_AGENT_ENDPOINT"]) | ||
| AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME=$($envVars["AZURE_AI_AGENT_MODEL_DEPLOYMENT_NAME"] ?? "gpt-4.1-mini") | ||
| AZURE_AI_AGENT_API_VERSION=$($envVars["AZURE_AI_AGENT_API_VERSION"] ?? "2025-05-01-preview") | ||
| AZURE_AI_AGENT_PROJECT_CONNECTION_STRING=$($envVars["AZURE_AI_AGENT_PROJECT_CONNECTION_STRING"]) | ||
| AZURE_COGNITIVE_SERVICES=$($envVars["AZURE_COGNITIVE_SERVICES"] ?? "https://cognitiveservices.azure.com/.default") |
Comment on lines
+866
to
+867
| Write-LogWarn "Execution policy is Restricted. Setting to RemoteSigned..." | ||
| Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -Force |
| az webapp config appsettings set --name $script:FrontendApp --resource-group $ResourceGroup ` | ||
| --settings DOCKER_REGISTRY_SERVER_URL="https://$($script:AcrLoginServer)" --output none | ||
| az webapp config set --name $script:FrontendApp --resource-group $ResourceGroup ` | ||
| --generic-configurations '{\"acrUseManagedIdentityCreds\": true}' --output none |
Comment on lines
+608
to
+616
| az webapp config appsettings set --name $script:FrontendApp --resource-group $ResourceGroup ` | ||
| --settings DOCKER_REGISTRY_SERVER_URL="https://$($script:AcrLoginServer)" --output none | ||
| az webapp config set --name $script:FrontendApp --resource-group $ResourceGroup ` | ||
| --generic-configurations '{\"acrUseManagedIdentityCreds\": true}' --output none | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-LogError "Frontend registry config FAILED — image pull may fail." | ||
| } else { | ||
| Write-LogSuccess "Frontend registry config updated" | ||
| } |
Comment on lines
+164
to
+171
| # Terminal 2 — MCP Server (port 9000) | ||
| cd src/mcp_server | ||
| source .venv/Scripts/activate | ||
| python mcp_server.py | ||
|
|
||
| # Terminal 3 — Frontend (port 3000) | ||
| cd src/App | ||
| npm run dev |
…nce in setup scripts
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Purpose
Local Development Setup Documentation (
AutomatedLocalSetup.md):setup_local_dev.shfor Linux/macOS/WSL andsetup_local_dev.ps1for Windows PowerShell) that automate the entire local development environment setup, including Azure authentication, environment file generation, dependency installation, RBAC role assignment, and VS Code configuration.Deployment to Azure Documentation (
DeployLocalChanges.md):deploy_to_azure.shfor Linux/macOS/WSL anddeploy_to_azure.ps1for Windows PowerShell) that detect changed services, build and push Docker images, and update Azure resources.git diff, ACR selection and authentication, command-line options, usage examples, and rollback instructions.Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information