Azure Cheatsheet
App Service
Use this Azure reference while you build software engineering projects, review code for technical interview prep, or polish examples for a software engineer resume.
Plans & Tiers
| Tier | Plan | vCPU | RAM | Notes |
|---|---|---|---|---|
| Free | F1 | shared | 1 GB | 60 min/day CPU, no custom domain |
| Shared | D1 | shared | 1 GB | Custom domain, no SSL |
| Basic | B1/B2/B3 | 1–4 | 1.75–7 GB | Manual scale, custom SSL |
| Standard | S1/S2/S3 | 1–4 | 1.75–7 GB | Auto-scale, staging slots (5) |
| Premium v3 | P0v3–P3v3 | 1–8 | 4–32 GB | Zone redundancy, 30 slots |
| Isolated v2 | I1v2–I6v2 | 2–32 | 8–128 GB | Dedicated VNet (ASE v3) |
# Create a plan az appservice plan create \ --name myPlan \ --resource-group myRG \ --location eastus \ --sku B1 \ --is-linux # omit for Windows # List plans az appservice plan list -g myRG -o table # Scale plan (change SKU) az appservice plan update --name myPlan -g myRG --sku S2 # Delete plan (delete all apps in it first) az appservice plan delete --name myPlan -g myRG --yes
Create & Deploy a Web App
# Create (runtime = <stack>|<version>) az webapp create \ --name myapp \ --resource-group myRG \ --plan myPlan \ --runtime "NODE|20-lts" # Common runtimes # "PYTHON|3.12" "NODE|20-lts" "DOTNETCORE|8.0" # "PHP|8.2" "JAVA|17-java17" (Windows: "node|20LTS") # Deploy from local Git az webapp deployment source config-local-git \ --name myapp -g myRG # Returns a Git remote URL — push to it to deploy # Deploy a ZIP file (fast) az webapp deploy \ --name myapp -g myRG \ --src-path ./dist.zip \ --type zip # Deploy from GitHub (CI/CD) az webapp create \ --name myapp -g myRG \ --plan myPlan \ --runtime "NODE|20-lts" \ --deployment-source-url https://github.com/org/repo \ --deployment-source-branch main
App Settings & Environment Variables
# Set app settings (env vars) az webapp config appsettings set \ --name myapp -g myRG \ --settings NODE_ENV=production DATABASE_URL="postgres://..." # List settings az webapp config appsettings list --name myapp -g myRG -o table # Delete a setting az webapp config appsettings delete \ --name myapp -g myRG \ --setting-names OLD_KEY # Show connection strings az webapp config connection-string list --name myapp -g myRG
Custom Domains & SSL
# Add a custom domain (DNS CNAME must point to <app>.azurewebsites.net first) az webapp config hostname add \ --webapp-name myapp -g myRG \ --hostname www.example.com # List hostnames az webapp config hostname list --webapp-name myapp -g myRG -o table # Create a free managed certificate (Standard+ plan) az webapp config ssl create \ --name myapp -g myRG \ --hostname www.example.com # Bind the certificate az webapp config ssl bind \ --name myapp -g myRG \ --certificate-thumbprint <thumbprint> \ --ssl-type SNI
Deployment Slots
# Create a staging slot az webapp deployment slot create \ --name myapp -g myRG \ --slot staging # Deploy to staging az webapp deploy \ --name myapp -g myRG \ --slot staging \ --src-path ./dist.zip --type zip # Swap staging → production az webapp deployment slot swap \ --name myapp -g myRG \ --slot staging \ --target-slot production # Preview swap (traffic routing) az webapp traffic-routing set \ --name myapp -g myRG \ --distribution staging=20 # 20% to staging # List slots az webapp deployment slot list --name myapp -g myRG -o table
Scaling
# Manual scale (Basic+) az appservice plan update --name myPlan -g myRG --number-of-workers 3 # Enable autoscale (Standard+) az monitor autoscale create \ -g myRG \ --resource myPlan \ --resource-type Microsoft.Web/serverfarms \ --name autoscale \ --min-count 1 --max-count 10 --count 2 # Add scale-out rule (CPU > 70%) az monitor autoscale rule create \ -g myRG --autoscale-name autoscale --scale out 1 \ --condition "Percentage CPU > 70 avg 5m"
Logs & Monitoring
# Enable logging az webapp log config \ --name myapp -g myRG \ --application-logging filesystem \ --level information \ --web-server-logging filesystem \ --detailed-error-messages true # Stream live logs az webapp log tail --name myapp -g myRG # Download logs az webapp log download --name myapp -g myRG --log-file ./logs.zip # Show recent log (last 100 lines) az webapp log show --name myapp -g myRG --provider application
SSH into Container (Linux Apps)
# Open browser-based SSH az webapp ssh --name myapp -g myRG # Or via Kudu REST curl -u "\$myapp:<deploy-password>" \ https://myapp.scm.azurewebsites.net/api/command \ -d '{"command":"ls /home/site/wwwroot"}'
Container Deploy (Docker)
# Deploy a Docker image az webapp config container set \ --name myapp -g myRG \ --container-image-name nginx:latest # From a private registry az webapp config container set \ --name myapp -g myRG \ --container-image-name myregistry.azurecr.io/myapp:v1 \ --container-registry-url https://myregistry.azurecr.io \ --container-registry-user myregistry \ --container-registry-password <password> # Enable continuous deployment (webhook from ACR) az webapp deployment container config \ --name myapp -g myRG \ --enable-cd true