Azure App Service
Building a web application and deploying it to the internet used to require setting up web servers, installing software, configuring load balancers, and managing SSL certificates. Azure App Service removes all of that infrastructure work. It is a fully managed PaaS platform for hosting web applications, REST APIs, and mobile backends — without managing any underlying servers.
What is Azure App Service?
Azure App Service is a PaaS (Platform as a Service) offering that lets developers deploy and run web applications by simply pushing code. Microsoft manages the operating system, server patches, runtime updates, load balancing, and scaling automatically.
App Service supports multiple programming languages and frameworks without any additional setup:
- .NET and .NET Core
- Node.js
- Python
- Java
- PHP
- Ruby
- Docker containers (custom runtimes)
App Service Plan
An App Service Plan defines the compute resources (virtual machine size, number of instances) that an App Service runs on. The plan determines the cost and the features available. Multiple App Services can share the same App Service Plan.
App Service Plan Pricing Tiers
| Tier | Type | Features | Best For |
|---|---|---|---|
| Free (F1) | Shared | 60 minutes CPU/day, no custom domain | Learning, demos |
| Shared (D1) | Shared | Custom domain, 240 min CPU/day | Very small websites |
| Basic (B1/B2/B3) | Dedicated | Custom domain, SSL, manual scaling up to 3 instances | Dev/test applications |
| Standard (S1/S2/S3) | Dedicated | Auto-scaling, staging slots, daily backups, 5 instances | Production web apps |
| Premium (P1v3/P2v3/P3v3) | Dedicated | Higher performance, VNet integration, 30 instances | High-traffic production apps |
| Isolated (I1v2/I2v2/I3v2) | Dedicated VNet | Private VNet, dedicated hardware, max scale | Compliance-heavy enterprise apps |
Deployment Methods
Code can be deployed to Azure App Service in multiple ways:
Continuous Deployment (CI/CD)
Connect App Service directly to a code repository. Every time code is pushed, Azure automatically builds and deploys the new version.
- GitHub Actions
- Azure DevOps Pipelines
- Bitbucket
ZIP or WAR Deploy
Package the application into a ZIP file and deploy it using Azure CLI or the Kudu console. Quick and straightforward for manual deployments.
FTP / FTPS
Upload files directly to the App Service file system using FTP. Simple but not recommended for production — CI/CD pipelines are preferred.
Docker Container
Deploy a Docker container image from Azure Container Registry, Docker Hub, or any private registry. Ideal when full control over the runtime environment is required.
Example: Deploy a Node.js App via Azure CLI
# Step 1: Create a resource group
az group create --name myAppRG --location eastus
# Step 2: Create an App Service Plan
az appservice plan create \
--name myAppPlan \
--resource-group myAppRG \
--sku B1 \
--is-linux
# Step 3: Create the web app
az webapp create \
--name myNodeApp2024 \
--resource-group myAppRG \
--plan myAppPlan \
--runtime "NODE:18-lts"
# Step 4: Deploy code from a ZIP file
az webapp deploy \
--name myNodeApp2024 \
--resource-group myAppRG \
--src-path ./app.zip
Deployment Slots
Deployment slots are separate live environments within an App Service. The Standard tier and above support multiple slots (production, staging, testing, etc.).
How Deployment Slots Work
App Service: myNodeApp2024
├── Production Slot → https://mynodeapp2024.azurewebsites.net
│ └── Current live version (v1.0)
│
└── Staging Slot → https://mynodeapp2024-staging.azurewebsites.net
└── New version under testing (v2.0)
After testing is complete:
──► SWAP staging ↔ production (zero downtime)
Production now runs v2.0
Staging now runs the old v1.0 (easy rollback if needed)
Slot swap performs a zero-downtime deployment — traffic shifts instantly from the old version to the new one. If problems are found, swapping back restores the previous version in seconds.
Auto Scaling
App Service supports two types of scaling:
- Scale Up (Vertical): Move to a larger App Service Plan with more CPU and memory. Requires a brief restart.
- Scale Out (Horizontal): Add more instances of the same App Service Plan to handle more traffic. Configured using rules based on CPU percentage, memory, or HTTP request queue length. Standard tier and above support auto scale-out.
Custom Domain and SSL
Every App Service gets a default domain like appname.azurewebsites.net. A custom domain (e.g., www.mycompany.com) can be added by:
- Adding a CNAME or A record in the domain registrar's DNS settings pointing to the App Service.
- Verifying domain ownership in the App Service settings.
- Adding a free managed SSL certificate from App Service (available on Basic tier and above).
App Service Environment (ASE)
App Service Environment is a premium, fully isolated deployment of App Service inside a dedicated Azure VNet. It provides the highest scale, security, and network isolation. ASE is used for compliance-heavy workloads (banking, healthcare) where the application must not share any infrastructure with other tenants.
Key Takeaways
- Azure App Service is a managed PaaS platform for hosting web apps, APIs, and mobile backends.
- It supports .NET, Node.js, Python, Java, PHP, Ruby, and Docker containers.
- The App Service Plan defines the compute resources and determines available features and cost.
- Deployment slots enable zero-downtime deployments with easy rollback capability.
- Auto-scaling (scale-out) adds instances automatically based on demand metrics.
- Custom domains with free managed SSL certificates are supported on Basic tier and above.
