Azure App Service: Deploy a Web App the Easy Way

Khimananda Oli 7 min read Database
Azure App Service: Deploy a Web App the Easy Way

By Khimananda Oli | Last reviewed: August 2026

Shipping code to production shouldn't require managing virtual machines or wrestling with complex networking configurations. Azure App Service: Deploy a Web App the Easy Way abstracts infrastructure management while maintaining enterprise-grade security and scalability, making it ideal for teams transitioning from shared hosting or VPS setups. If you are evaluating cloud options or migrating legacy applications, understanding this platform-as-a-service (PaaS) model is essential before committing resources. For teams comparing providers, my guide on AWS vs Azure vs Google Cloud provides critical context on where App Service fits in the broader ecosystem.

GitHub RepoSource Code+ Workflow YAMLGitHub ActionsOIDC FederationBuild & TestAzure App ServiceManaged RuntimeAuto-scalingSSL / BackupsNo VMs • No OS Patching • Zero Credential Storage
High-level architecture for Azure App Service: Deploy a Web App the Easy Way using OIDC-based CI/CD

How do you provision Azure App Service infrastructure securely?

The "easy way" does not mean clicking through the Azure Portal. Manual portal deployments create drift, lack audit trails, and fail compliance reviews. In practice, I always define App Service resources in Terraform or Bicep. This ensures your staging and production environments remain identical and recoverable.

Define the App Service Plan and Web App

Your App Service Plan defines the compute footprint. A common mistake is selecting the Basic tier for production workloads; it lacks autoscale and SLA guarantees. Always use Standard (S1) or Premium V3 (P1v3) for any business-critical application. The following Terraform configuration establishes a secure baseline:

resource "azurerm_service_plan" "app" {
  name                = "asp-myapp-prod"
  location            = azurerm_resource_group.main.location
  resource_group_name = azurerm_resource_group.main.name
  os_type             = "Linux"
  sku_name            = "P1v3"

  tags = {
    Environment = "Production"
    ManagedBy   = "Terraform"
  }
}

resource "azurerm_linux_web_app" "main" {
  name                = "myapp-prod"
  resource_group_name = azurerm_resource_group.main.name
  location            = azurerm_resource_group.main.location
  service_plan_id     = azurerm_service_plan.app.id

  site_config {
    always_on               = true
    ftps_state              = "Disabled"
    minimum_tls_version     = "1.3"
    http2_enabled           = true
    
    application_stack {
      node_version = "20-lts"
    }
  }

  identity {
    type = "SystemAssigned"
  }
}

Note the identity block enabling System-Assigned Managed Identity. This is non-negotiable for secure database and storage access without storing connection strings or secrets in your codebase. Disabling FTPS and enforcing TLS 1.3 aligns with SOC 2 and ISO 27001 control requirements for data-in-transit encryption.

How do you configure zero-secret deployments with OIDC?

Storing Azure credentials as GitHub Secrets is an anti-pattern. Credentials rotate poorly, leak easily, and violate least-privilege principles. OpenID Connect (OIDC) federation allows GitHub Actions to request short-lived tokens directly from Azure AD, eliminating long-lived secrets entirely.

Set up Azure Federated Identity Credential

First, create an Azure AD Application Registration and configure federated credentials that trust your specific GitHub repository and branch. Then assign the Contributor role (or a custom RBAC role scoped to the resource group) to the service principal. Your workflow authenticates without ever touching a password:

name: Deploy to Azure App Service
on:
  push:
    branches: [ main ]

permissions:
  id-token: write
  contents: read

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Azure Login (OIDC)
        uses: azure/login@v2
        with:
          client-id: ${{ secrets.AZURE_CLIENT_ID }}
          tenant-id: ${{ secrets.AZURE_TENANT_ID }}
          subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

      - name: Build and Deploy
        uses: azure/webapps-deploy@v3
        with:
          app-name: myapp-prod
          package: .
          startup-command: "npm start"

This pattern mirrors the secure automation practices discussed in CI/CD pipeline setup guides, adapted for Azure's native identity platform. The token lives only for the duration of the job execution and cannot be exfiltrated for later use.

GitHub ActionsAzure AD / EntraApp Service1. Request Token (OIDC)2. Short-lived JWT3. Deploy with Token4. Success ResponseToken expires after job completion — no persistent secrets stored anywhere
OIDC token exchange sequence eliminating long-lived credentials in Azure App Service deployments

How do you manage application settings and environment variables?

Never commit secrets to source control. Azure App Service injects Application Settings as environment variables at runtime, overriding any values in your .env file. Configure these through Terraform or the CLI, not the portal, to maintain version control over your configuration.

  • Connection Strings: Use Managed Identity endpoints for Azure SQL, Cosmos DB, and Storage Accounts instead of username/password pairs.
  • API Keys: Store third-party keys in Azure Key Vault and reference them via Key Vault References in App Settings (@Microsoft.KeyVault(SecretUri=...)).
  • Feature Flags: Use Azure App Configuration for dynamic feature toggles without redeployment.
  • Slot-Specific Settings: Mark deployment-sensitive settings as "slot setting" to prevent accidental swaps between staging and production.

This separation of code and configuration is fundamental to twelve-factor app methodology and required for any serious compliance framework. Teams familiar with traditional VPS deployments often struggle initially with this paradigm shift, but it dramatically reduces incident surface area.

When should you choose App Service over Kubernetes or VMs?

App Service is not universally superior. Understanding its trade-offs prevents costly architectural mistakes. Use this comparison when advising stakeholders or planning migrations:

CriteriaAzure App ServiceAzure Kubernetes (AKS)Virtual Machines
Time-to-productionHoursDays to weeksDays
Operational overheadNear-zero (managed PaaS)High (cluster ops, upgrades)Highest (OS, runtime, patching)
Custom networkingVNet integration available; limited egress controlFull CNI/CNI Overlay, Network PoliciesComplete NSG/routing control
Cost at low scale$50–150/month (Standard)$70+/month minimum + nodes$30–80/month per VM
Compliance readinessSOC 1/2, ISO 27001 certified; built-in loggingCertified; requires additional policy/gatekeeper setupCertified; full manual hardening required
Best fitWeb apps, APIs, CMS, SaaS backendsMicroservices, high-scale, custom runtimesLegacy apps, GPU workloads, full OS control

In my experience helping Nepali businesses migrate from shared hosting, App Service consistently delivers the fastest path to compliant cloud infrastructure. Reserve AKS for systems requiring true microservice decomposition or custom operators. If your team lacks dedicated platform engineers, App Service’s managed nature prevents operational burnout.

Start: New WorkloadNeed custom OS/kernel?GPU / legacy binary?YesVirtual MachinesNo>10 services? Custom operators?Dedicated platform team?YesAzure AKSNoAzure App Service ✓Fastest path to secure, compliant production
Decision framework for choosing Azure App Service over AKS or VMs based on operational capacity

What post-deployment checks ensure production readiness?

Deployment success does not equal production readiness. Implement these verification steps in your pipeline or runbook immediately after every release:

  1. Health probe validation: Confirm /health returns 200 within 5 seconds. App Service uses this endpoint for load balancer decisions; misconfiguration causes silent outages.
  2. TLS certificate check: Verify certificate expiry and chain validity. Enable auto-renewal for App Service Managed Certificates or integrate Let's Encrypt as shown in SSL automation guides.
  3. Application Insights smoke test: Query dependency telemetry to confirm database and external API connectivity post-deploy.
  4. Backup verification: Ensure automated backups completed successfully and point-in-time restore is functional. Test restores quarterly.
  5. Access control audit: Review RBAC assignments and managed identity permissions. Remove stale access immediately.

These checks transform deployments from hopeful events into verified state transitions. Automation here pays dividends during incident response and compliance audits alike.

Moving Forward with Confidence

Azure App Service: Deploy a Web App the Easy Way succeeds when you treat "easy" as engineered simplicity, not shortcut-taking. Provision with infrastructure-as-code, authenticate via OIDC, externalize configuration properly, and validate rigorously post-deploy. This discipline separates hobby projects from production systems that survive traffic spikes, security reviews, and auditor scrutiny. If your team needs hands-on guidance implementing this stack or assessing whether App Service fits your specific workload, reach out to discuss your architecture. Getting the foundation right now prevents expensive rework later.

Frequently Asked Questions

Use the Azure CLI command az webapp up. It automatically creates the resource group, plan, and app service while deploying your local code in a single step without manual portal configuration or complex pipeline setup.

The B1 Basic tier costs approximately thirteen dollars monthly in 2026. This includes one core, 1.75 GB RAM, and ten GB storage, suitable for development or low-traffic production workloads requiring custom domains and SSL certificates.

Yes. Configure the startup command to point to public/index.php and set APP_ENV in application settings. Ensure the PHP version matches your composer.json requirements and install dependencies via a custom deployment script or GitHub Actions workflow.

Enable HTTPS Only in the TLS/SSL settings blade. This forces all HTTP traffic to redirect to HTTPS automatically at the platform level without modifying application code or configuring web server rewrite rules manually.

App Service hosts long-running web applications with full OS access and scaling units. Functions execute event-driven, serverless code billed per execution. Choose App Service for traditional web apps and Functions for background tasks or API microservices.

Use managed identity authentication instead of connection strings. Enable system-assigned identity on the App Service, grant it db_datareader permissions in Azure SQL, and reference the credential-free endpoint in your application configuration settings.

Check the Diagnose and Solve Problems blade for application exceptions. Common causes include missing environment variables, incompatible runtime versions, or failed dependency installations during deployment. Review the Log Stream tool for real-time error output.

No. Custom domains require at least the Shared or Basic tier. The Free and F1 tiers only support the default azurewebsites.net subdomain and lack SSL binding capabilities needed for production custom domain configurations.

Configure scale-out rules based on CPU, memory, or HTTP queue length metrics. Standard tier and above support automatic instance scaling from one to ten instances. Premium tiers allow higher limits and faster scale-out response times.

Yes. Select the Docker container option during creation and specify your registry image. App Service pulls and runs the container with configurable ports, environment variables, and persistent storage mounts via Azure Files or Blob Storage.

Turn on Application Logging (Filesystem) and Web Server Logging in the App Service Logs blade. Set the log level to Error or Warning. Access logs via FTP, Kudu console, or stream them live using the Azure CLI.

Deployment slots require Standard tier or higher. They provide isolated staging environments with separate hostnames. Swap slots to promote code to production instantly with zero downtime while preserving warm-up state and avoiding cold starts.

Enable VNET integration, private endpoints, and managed identities. Disable public network access if using private connectivity. Apply TLS 1.3 minimum, configure WAF via Front Door, and audit access through Azure Monitor and Defender for Cloud.

Use the built-in WebJobs feature for cron-scheduled scripts or binaries. Alternatively, integrate Azure Logic Apps or Functions for complex orchestration. WebJobs run in the same sandbox as your app and share its resources.

Use Dev/Test pricing plans which offer discounted rates for Visual Studio subscribers. Scale down to B1 or S1 tiers outside business hours using automation runbooks, or delete resources entirely when not actively developing or testing.