Azure App Service — Deploy Your Web App in 5 Minutes
You have built a Node.js API and need it running in production — with SSL, auto-scaling, and zero-downtime deployments. You could spend a week setting up VMs, load balancers, and reverse proxies. Or you could use Azure App Service and deploy in under 5 minutes. Here is the fast path.
What Is Azure App Service?
App Service is Azure's fully managed platform for hosting web applications, REST APIs, and mobile backends. You push code, Azure handles the servers, patching, scaling, and load balancing.
It supports Node.js, Python, .NET, Java, PHP, Ruby, Go, and custom Docker containers — basically anything that listens on an HTTP port.
App Service Plans — Pick Your Hardware
Every App Service runs on an App Service Plan, which defines the compute resources. Here is what you get at each tier:
| Tier | vCPU | RAM | Storage | Custom Domain | SSL | Slots | Auto-Scale | Price (approx) |
|---|---|---|---|---|---|---|---|---|
| Free (F1) | Shared | 1 GB | 1 GB | No | No | 0 | No | $0 |
| Basic (B1) | 1 | 1.75 GB | 10 GB | Yes | Yes | 0 | No | ~$13/mo |
| Standard (S1) | 1 | 1.75 GB | 50 GB | Yes | Yes | 5 | Yes | ~$70/mo |
| Premium (P1v3) | 2 | 8 GB | 250 GB | Yes | Yes | 20 | Yes | ~$138/mo |
Rule of thumb: Use Free for experiments, Basic for dev/staging, Standard for production apps that need deployment slots, and Premium for high-traffic production workloads.
Creating and Deploying Your App
Step 1: Create the App Service
# Create a resource group
az group create --name rg-webapp-prod --location eastus
# Create a Linux App Service Plan (Standard tier)
az appservice plan create \
--name plan-webapp-prod \
--resource-group rg-webapp-prod \
--sku S1 \
--is-linux
# Create the web app with Node.js 20
az webapp create \
--resource-group rg-webapp-prod \
--plan plan-webapp-prod \
--name myapp-prod-2025 \
--runtime "NODE|20-lts"
Step 2: Deploy Your Code
The fastest method for a quick deploy — ZIP deployment:
# Package your app
cd /path/to/your/app
zip -r deploy.zip . -x "node_modules/*" ".git/*"
# Deploy the ZIP file
az webapp deploy \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--src-path deploy.zip \
--type zip
Deployment Methods Compared
| Method | Best For | Setup Effort | CI/CD Ready |
|---|---|---|---|
| ZIP Deploy | Quick one-off deploys | Minimal | Via scripts |
| Local Git | Solo developers | Low | No |
| GitHub Actions | Team workflows | Medium | Yes |
| Docker | Custom runtimes | Medium | Yes |
| Azure DevOps | Enterprise pipelines | Higher | Yes |
Deploy via Local Git
# Configure local Git deployment
az webapp deployment source config-local-git \
--resource-group rg-webapp-prod \
--name myapp-prod-2025
# Get the Git URL (output contains the remote URL)
az webapp deployment list-publishing-credentials \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--query scmUri \
--output tsv
# Add Azure as a Git remote and push
git remote add azure <git-url-from-above>
git push azure main
Deploy a Docker Container
# Create a web app from a Docker image
az webapp create \
--resource-group rg-webapp-prod \
--plan plan-webapp-prod \
--name myapp-docker-2025 \
--deployment-container-image-name nginx:latest
# Use a custom image from Azure Container Registry
az webapp create \
--resource-group rg-webapp-prod \
--plan plan-webapp-prod \
--name myapp-docker-2025 \
--deployment-container-image-name myregistry.azurecr.io/myapp:v2.1.0
Custom Domains and SSL
Adding a Custom Domain
# Map your custom domain
az webapp config hostname add \
--resource-group rg-webapp-prod \
--webapp-name myapp-prod-2025 \
--hostname www.myapp.com
# Verify the mapping
az webapp config hostname list \
--resource-group rg-webapp-prod \
--webapp-name myapp-prod-2025 \
--output table
Before running the command above, add a CNAME record pointing www.myapp.com to myapp-prod-2025.azurewebsites.net in your DNS provider.
Free Managed SSL Certificate
# Create a free managed SSL certificate
az webapp config ssl create \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--hostname www.myapp.com
# Bind the certificate
az webapp config ssl bind \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--certificate-thumbprint <thumbprint-from-above> \
--ssl-type SNI
# Enforce HTTPS
az webapp update \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--https-only true
Deployment Slots — Zero-Downtime Deployments
Deployment slots are live instances of your app with their own hostnames. The killer feature is swapping — you deploy to a staging slot, test it, then swap staging and production atomically with zero downtime.
# Create a staging slot
az webapp deployment slot create \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--slot staging
# Deploy to the staging slot
az webapp deploy \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--slot staging \
--src-path deploy.zip \
--type zip
# Test staging at: myapp-prod-2025-staging.azurewebsites.net
# Swap staging into production (zero downtime)
az webapp deployment slot swap \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--slot staging \
--target-slot production
If something goes wrong after the swap, swap again to roll back instantly. This workflow eliminates deployment anxiety.
Application Settings and Connection Strings
App Service provides environment variables through application settings — no config files committed to source control.
# Set application settings (environment variables)
az webapp config appsettings set \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--settings \
NODE_ENV=production \
API_KEY=your-api-key-here \
DATABASE_URL="postgresql://user:pass@dbserver:5432/mydb"
# List current settings
az webapp config appsettings list \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--output table
# Mark a setting as a "slot setting" (sticky to the slot, not swapped)
az webapp config appsettings set \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--slot-settings NODE_ENV=production
Slot settings stay with the slot during a swap. Use this for environment-specific values like NODE_ENV=staging vs NODE_ENV=production.
Auto-Scaling Rules
Standard tier and above support auto-scaling based on metrics:
# Create auto-scale setting
az monitor autoscale create \
--resource-group rg-webapp-prod \
--resource plan-webapp-prod \
--resource-type Microsoft.Web/serverFarms \
--min-count 2 \
--max-count 10 \
--count 2
# Scale out when CPU exceeds 70%
az monitor autoscale rule create \
--resource-group rg-webapp-prod \
--autoscale-name plan-webapp-prod \
--condition "CpuPercentage > 70 avg 5m" \
--scale out 2
# Scale in when CPU drops below 30%
az monitor autoscale rule create \
--resource-group rg-webapp-prod \
--autoscale-name plan-webapp-prod \
--condition "CpuPercentage < 30 avg 10m" \
--scale in 1
Health Checks
Health checks let App Service ping an endpoint in your app. If it returns a non-200 status, the instance is automatically removed from the load balancer.
# Enable health check on a specific path
az webapp config set \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--generic-configurations '{"healthCheckPath": "/api/health"}'
Make sure your /api/health endpoint checks downstream dependencies (database, cache, external APIs) and returns 200 only when everything is healthy.
Viewing Logs
# Enable application logging
az webapp log config \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--application-logging filesystem \
--level information
# Stream logs in real time (like tail -f)
az webapp log tail \
--resource-group rg-webapp-prod \
--name myapp-prod-2025
# Download log files
az webapp log download \
--resource-group rg-webapp-prod \
--name myapp-prod-2025 \
--log-file app-logs.zip
Wrapping Up
Azure App Service removes the undifferentiated heavy lifting of server management so you can focus on your application. Start with ZIP deployment for speed, graduate to GitHub Actions for CI/CD, and use deployment slots for zero-downtime production releases. The combination of auto-scaling and health checks means your app handles traffic spikes without you waking up at 3 AM.
Next up: Azure Virtual Networks — VNets, Subnets, NSGs, and Peering. We will build the network foundation that connects all your Azure resources securely.
