Azure App Service
Overview
Azure App Service is a fully managed platform for building, hosting, and scaling web applications, REST APIs, and mobile backends.
You focus on your code, and Azure handles infrastructure, patching, scaling, and load balancing behind the scenes.
It supports multiple stacks out of the box: .NET, .NET Core, Java, Node.js, PHP, Python, and Docker containers.
Key Features
- Managed hosting for web apps and APIs (PaaS – Platform as a Service)
- Built-in CI/CD integration with GitHub, Azure DevOps, etc.
- Custom domains & SSL support
- Autoscaling and high availability (including staging slots)
- Authentication/authorization via Azure AD, Facebook, Google, etc.
- Deployment slots for safe releases and testing
- Easy diagnostics and logging via App Insights, Kudu, and built-in monitoring
Advantages
- No infrastructure management – Deploy your code, Azure handles the OS, scaling, and maintenance.
- Quick deployment – Push code via Git, GitHub, DevOps, or even ZIP deploy.
- High productivity – Great for MVPs and microservices with fast release cycles.
- Global scale – Deploy in any Azure region.
- Staging slots – Swap between "staging" and "production" with zero downtime.
- Integrated monitoring – Logs, metrics, and alerts are easy to configure.
Drawbacks / Limitations
- Limited control over the environment – You can't access the OS directly (unlike a VM or container).
- Cold starts – In the Free/Shared or Consumption Plan (for Function Apps), performance may lag after idle periods.
- More expensive than containers/VMs for large-scale, high-traffic apps.
- Linux vs Windows App Services – Feature availability differs slightly.
Example: Hosting a .NET Core API
You build a simple .NET Web API:
[ApiController]
[Route("api/[controller]")]
public class ProductsController : ControllerBase
{
[HttpGet]
public IActionResult Get()
{
return Ok(new[] { "Apples", "Bananas", "Oranges" });
}
}
To deploy this:
- Publish to App Service using Visual Studio or
dotnet publish + Azure CLI
- Azure hosts the API at a public endpoint:
https://my-retail-api.azurewebsites.net/api/products
- You can scale the service, apply logging, configure custom domains, or connect to Azure SQL, Redis, etc.
Deployment Options
- Azure Portal – Manual zip deploy or publish from Visual Studio
- GitHub Actions – Trigger builds on commit
- Azure DevOps Pipelines
- FTP / Web Deploy / CLI / REST API
Deployment Slots (Premium Plans)
Use slots to:
- Deploy to staging while production runs undisturbed.
- Run warmup tests.
- Swap when you're ready, avoiding cold starts or downtime.
Monitoring & Diagnostics
Integrated with:
- Application Insights – Telemetry, tracing, performance monitoring
- Log streaming – Real-time logs
- Kudu console – Advanced diagnostics and command-line access
Security Features
- Authentication/Authorization – Built-in identity providers (AAD, Facebook, Twitter)
- VNet Integration – Access resources inside private networks
- Managed Identity – Securely access Azure resources like Key Vault
When to Use Azure App Service
- Hosting web APIs or websites without managing servers
- Projects needing fast deployment, autoscaling, and CI/CD
- Scenarios where you want to focus on features, not infrastructure
- Integrating tightly with other Azure services (SQL, Blob Storage, Key Vault)
Conceptual Model
Think of Azure App Service as a Web App container on-demand, where you just drop your code and it runs:
- No IIS config
- No patching
- No VM setup
You scale from one instance to many in seconds, and you can plug in auth, logging, and networking without major config.