| layout | showcase-page | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| title | Azure Developer CLI Deployment | ||||||||||||||
| permalink | /reference/deploy/azd-cli_deploy/ | ||||||||||||||
| menubar | docs_menu | ||||||||||||||
| accent | emerald | ||||||||||||||
| eyebrow | Deployment Reference | ||||||||||||||
| description | Deploy Simple Chat with Azure Developer CLI when you want the repo's most current, end-to-end supported rollout path. | ||||||||||||||
| hero_icons |
|
||||||||||||||
| hero_pills |
|
||||||||||||||
| hero_links |
|
||||||||||||||
| nav_links |
|
||||||||||||||
| show_nav | true |
Azure Developer CLI handles the cleanest end-to-end deployment flow in this repo. Use it when you want infrastructure provisioning, environment configuration, and application deployment to stay in one documented path.
AZD drives the Bicep templates for the required Azure resources instead of making you stitch together the provisioning steps manually.
Subscription, region, environment naming, and optional environment settings all stay tied to the AZD environment instead of scattered across ad hoc scripts.
The current path is container-based App Service, so the image runtime and startup behavior are handled by the deployment model rather than a native Python startup command.
Use AZD commands for logs, monitoring, environment inspection, and upgrade decisions without switching to a separate deployment toolset midstream.
The repo's AZD workflow deploys a container-based App Service. Do not add a native Python App Service startup command unless you intentionally move away from the container runtime later.
Azure Developer CLI is Microsoft's tool for streamlined application deployment to Azure. For Simple Chat, azd:
- Provisions all required Azure resources
- Configures service connections
- Deploys the application code
- Sets up monitoring and logging
This is the primary recommended deployment path for the repo.
- Azure Developer CLI (install guide)
- Git for repository cloning
- Azure CLI (usually installed with azd)
- Azure subscription with contributor access
- Resource quota for required services in target region
- Permissions to create service principals (if not using existing)
- ✅ Azure Commercial
- ✅ Azure Government (with environment configuration)
- ✅ Local development environments
- ✅ CI/CD pipelines
- The current
azddeployment path in this repo is a container-based App Service deployment. - Gunicorn is started by the container entrypoint in
application/single_app/Dockerfile. - You do not need to populate App Service Stack Settings Startup command when deploying through this
azdpath. - If you later switch to native Python App Service instead, deploy the
application/single_appfolder and use this startup command:
python -m gunicorn -c gunicorn.conf.py app:appgit clone https://github.com/microsoft/simplechat.git
cd simplechat# Initialize the project
azd init
# Deploy to Azure
azd upThe azd up command will prompt for:
- Subscription selection
- Target region
- Environment name (used for resource naming)
- Additional configuration options
Initialize project:
azd initSelect template (if prompted):
- Choose "Simple Chat" from available templates
- Or use the current directory if already cloned
Set environment variables (optional):
# For Azure Government
azd env set AZURE_ENVIRONMENT usgovernment
# For custom regions
azd env set AZURE_LOCATION "East US 2"
# For specific naming prefix
azd env set RESOURCE_PREFIX "myorg"Review configuration:
azd env get-valuesFull deployment:
azd upThis command:
- Provisions infrastructure using Bicep templates
- Configures services with proper connections
- Deploys application code to App Service
- Sets up monitoring and logging
- Outputs connection information
Check deployment status:
azd showGet application URL:
azd env get-values | grep APP_URLTest application:
- Open the provided URL in browser
- Verify login functionality
- Test basic chat functionality
Set these before running azd up to customize deployment:
Core Settings:
# Deployment region
azd env set AZURE_LOCATION "East US"
# Resource naming prefix
azd env set RESOURCE_PREFIX "simplechat"
# Environment type (affects SKUs)
azd env set ENVIRONMENT_TYPE "dev|staging|prod"Service Configuration:
# Enable specific features
azd env set ENABLE_CONTENT_SAFETY "true"
azd env set ENABLE_IMAGE_GENERATION "true"
azd env set ENABLE_REDIS_CACHE "true"
# Set service tiers
azd env set APP_SERVICE_SKU "P1v3"
azd env set COSMOS_DB_THROUGHPUT "1000"
azd env set SEARCH_SKU "standard"Azure Government:
azd env set AZURE_ENVIRONMENT "usgovernment"
azd env set AZURE_LOCATION "USGov Virginia"Development/Testing:
azd env set ENVIRONMENT_TYPE "dev"
# Uses: B1 App Service, 400 RU/s Cosmos, Basic SearchProduction:
azd env set ENVIRONMENT_TYPE "prod"
# Uses: P1v3 App Service, 1000 RU/s Cosmos, Standard SearchCustom Sizing:
azd env set APP_SERVICE_SKU "P2v3"
azd env set COSMOS_DB_THROUGHPUT "4000"
azd env set SEARCH_SKU "standard2"
azd env set OPENAI_SKU "S0"- Navigate to deployed application
- Sign in with Azure AD account
- Assign admin role if needed:
# Get app registration details azd env get-values | grep APP_REGISTRATION # Assign admin role in Azure AD
Required configurations:
- Test all service connections in Admin Settings
- Configure default system prompt
- Set up document classification (optional)
- Enable additional features as needed
Recommended configurations:
- Set up Content Safety thresholds
- Configure file size limits
- Set conversation history limits
- Enable enhanced citations
Application Insights:
- Automatically configured by azd
- Access through Azure Portal
- Set up custom alerts and dashboards
Azure Monitor:
- Configure alerts for resource health
- Set up cost monitoring and budgets
- Create dashboards for operational metrics
Modify infrastructure by editing infra/main.parameters.json:
{
"parameters": {
"environmentName": "prod-simple-chat",
"location": "East US",
"appServiceSku": "P1v3",
"cosmosDbThroughput": 1000,
"searchSku": "standard",
"enableContentSafety": true,
"enableRedisCache": true
}
}Development environment:
azd env select dev
azd upProduction environment:
azd env select prod
azd env set ENVIRONMENT_TYPE "prod"
azd upGitHub Actions workflow: {% raw %}
- name: Azure Dev CLI Deploy
uses: Azure/azure-dev-cli@v1
with:
azure-credentials: ${{ secrets.AZURE_CREDENTIALS }}
run: |
azd auth login --client-id "${{ secrets.AZURE_CLIENT_ID }}" \
--client-secret "${{ secrets.AZURE_CLIENT_SECRET }}" \
--tenant-id "${{ secrets.AZURE_TENANT_ID }}"
azd deploy{% endraw %}
Use the command that matches the type of change you are making.
| If you changed... | Use | Why |
|---|---|---|
| Application code only | azd deploy |
Recommended default for routine container upgrades |
| Infrastructure only | azd provision |
Updates Azure resources without treating the release like a full app deployment |
| Application code and infrastructure together | azd up |
Runs the combined deployment flow |
Do not assume azd up is required for every release. For normal code-only container updates, start with azd deploy.
Deploy application updates:
azd deployRecommended for routine container-based application upgrades when infrastructure is unchanged.
Provision infrastructure changes:
azd provisionUse azd provision --preview first when you want to review infrastructure impact before applying it.
Full redeployment:
azd down --purge
azd upDo not use this as a standard upgrade flow. This is a destructive reprovisioning path.
List environments:
azd env listSwitch environments:
azd env select <environment-name>View configuration:
azd env get-valuesShow deployment info:
azd showMonitor application:
azd monitorView logs:
# Application logs
azd logs
# Infrastructure logs
azd logs --infrastructureAuthentication failures:
# Re-authenticate
azd auth login
# Check subscription access
az account showResource quota issues:
# Check quotas in target region
az vm list-usage --location "East US" --output table
# Try different region
azd env set AZURE_LOCATION "West US 2"Deployment failures:
# Check deployment logs
azd show --output json
# View detailed logs
azd logs --infrastructureAzure OpenAI not available:
- Verify Azure OpenAI is available in target region
- Check subscription whitelist status
- Request access through Azure portal
App Service deployment issues:
- Check App Service logs in Azure portal
- Verify application settings configuration
- Check for startup errors in Application Insights
Cosmos DB connection issues:
- Verify firewall settings allow App Service
- Check connection string configuration
- Test connectivity from App Service console
Rollback deployment:
# Get previous deployment
azd show --output json
# Redeploy specific version
git checkout <previous-version-tag>
azd deployClean slate redeployment:
# Remove all resources
azd down --purge
# Redeploy from scratch
azd up- ✅ Verify Azure subscription quotas in target region
- ✅ Plan resource naming conventions
- ✅ Review cost estimates for selected SKUs
- ✅ Prepare Azure AD configuration requirements
- ✅ Monitor deployment progress for errors
- ✅ Note down important URLs and connection strings
- ✅ Verify each service comes online successfully
- ✅ Document any custom configurations applied
- ✅ Test all application functionality end-to-end
- ✅ Configure monitoring and alerting
- ✅ Set up backup procedures for critical data
- ✅ Document operational procedures for team
- ✅ Review and configure Azure AD app registration
- ✅ Set up proper RBAC roles for users
- ✅ Enable managed identities where possible
- ✅ Configure network security if required
Monitor and adjust:
- Review cost reports after 30 days of usage
- Adjust service tiers based on actual utilization
- Use autoscaling for variable workloads
- Consider reserved instances for predictable usage
Cost-effective configurations:
# Development environments
azd env set APP_SERVICE_SKU "B1"
azd env set COSMOS_DB_THROUGHPUT "400"
azd env set SEARCH_SKU "basic"
# Production with cost optimization
azd env set ENABLE_REDIS_CACHE "false" # Start without Redis
azd env set COSMOS_DB_AUTOSCALE "true" # Use autoscale for variable loadThis Azure Developer CLI approach provides the fastest path from zero to a fully functional Simple Chat deployment with minimal manual configuration required.