Azure Functions Deployment
Deployment workflows for Azure Functions using AZD.
Prerequisites
- Azure Functions project prepared with azd template
azure.yamlexists and validated.azure/deployment-plan.mdstatus =Validated- Azure Functions Core Tools (optional, for local debugging or when using
funccommands outside azd workflows)
AZD Deployment
Full Deployment (Infrastructure + Code)
# Deploy everything
azd up --no-promptInfrastructure Only
# Provision infrastructure without deploying code
azd provision --no-promptApplication Only
# Deploy code to existing infrastructure
azd deploy --no-promptPreview Changes
# Preview changes before deployment
azd provision --previewEnvironment Configuration
Set AZD Environment Variables
These are for azd provisioning, not application runtime:
azd env set AZURE_LOCATION eastus2
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
# Show deployment details
azd showTesting HTTP Endpoints
⚠️ Never use
curl -I(HEAD) to test Azure Functions endpoints.
>
Azure Functions
[HttpTrigger]with"get"does not automatically handle HEAD requests. HEAD returns 404 from the routing layer even when GET works correctly, causing false-negative results and misdirected debugging.
✅ DO — Use GET with output suppression
# Check status code only (GET, don't follow redirects)
curl -s -o /dev/null -w "%{http_code}" "https://<func-name>.azurewebsites.net/api/<route>"
# Get status code and redirect URL
curl -s -o /dev/null -w "Status: %{http_code}\nRedirect: %{redirect_url}" "https://<func-name>.azurewebsites.net/api/<route>"
# Verbose output showing response headers (GET)
curl -sS -D - -o /dev/null "https://<func-name>.azurewebsites.net/api/<route>"❌ DON'T — Use HEAD requests
# DO NOT use this — returns 404 even when the function works
curl -I "https://<func-name>.azurewebsites.net/api/<route>"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