Azure Functions Deployment
<!-- taken from https://github.com/microsoft/GitHub-Copilot-for-Azure/blob/main/plugin/skills/azure-deploy/references/recipes/azd/functions-deploy.md -->Deployment workflows for Azure Functions using AZD.
Prerequisites
- •Azure Functions project prepared with azd template
- •
azure.yamlexists and validated - •
.azure/preparation-manifest.mdstatus =Validated - •Azure Functions Core Tools (optional, for local debugging or when using
funccommands outside azd workflows)
AZD Deployment
Full Deployment (Infrastructure + Code)
bash
# Deploy everything azd up --no-prompt
Infrastructure Only
bash
# Provision infrastructure without deploying code azd provision --no-prompt
Application Only
bash
# Deploy code to existing infrastructure azd deploy --no-prompt
Preview Changes
bash
# Preview changes before deployment azd provision --preview
Environment Configuration
Set AZD Environment Variables
These are for azd provisioning, not application runtime:
bash
azd env set AZURE_LOCATION eastus azd env set VNET_ENABLED false
⚠️ Important:
azd env setsets variables for the azd provisioning process, NOT application environment variables.
Verify Deployment
Check Function App Status
bash
# Show deployment details azd show
Monitoring
Monitor your Functions deployment through Azure Portal or use azd to view deployment status.
Common Issues
- •Deployment timeout: Use
azd upwith appropriate timeout settings - •Missing dependencies: Ensure package.json/requirements.txt is correct and committed
- •Function not appearing: Check azure.yaml service configuration
- •Cold start issues: Consider Premium plan configuration in Bicep templates
CI/CD Integration
For automated deployments with azd, see cicd/README.md for GitHub Actions and Azure DevOps integration.
Data Loss Warning
⚠️ CRITICAL:
azd downData Loss Warning
azd downpermanently deletes ALL resources in the environment, including:
- •Function Apps with all configuration and deployment slots
- •Storage accounts with all blobs and files
- •Key Vault with all secrets (use
--purgeto bypass soft-delete)- •Databases with all data (Cosmos DB, SQL, etc.)
Best practices:
- •Always use
azd provision --previewbeforeazd up- •Use separate environments for dev/staging/production
- •Back up important data before running
azd down
Next Steps
After deployment:
- •Verify functions are running
- •Test endpoints
- •Monitor Application Insights
- •Set up alerts and monitoring