← Back to list

How to Deploy a Web Application to Azure App Service (With CI/CD Automation)

If you’re building a web application and need a simple, scalable, fully managed hosting platform, Azure App Service is an excellent choice…

SiddheshNikam · 2025-05-16 23:16 · 0 claps · 2.9 min read
#java #maven #azure-app-service #website-publishing
Open on Medium ↗
Wiki topics: 🌐 · Web Development ☁️ · DevOps & Cloud

How to Deploy a Web Application to Azure App Service (With CI/CD Automation)

If you’re building a web application and need a simple, scalable, fully managed hosting platform, Azure App Service is an excellent choice. In this guide, I’ll walk you through how to host and continuously deploy your web app using Azure App Service — with automated CI/CD using GitHub.

This post covers both manual and automated deployment strategies using Azure CLI and GitHub Actions.

Why Azure App Service?

Azure App Service allows you to host modern web apps in your language of choice (Java, Python, Node.js, .NET, etc.) without managing the underlying infrastructure. You get:

  • Auto-scaling and load balancing
  • Built-in SSL and authentication
  • Fast CI/CD support (GitHub, Azure Repos, Bitbucket)
  • Native integration with Azure DevOps and monitoring tools

Prerequisites

To follow along, you’ll need:

  • An Azure subscription (free tier available)
  • Azure CLI installed and authenticated (az login)
  • Your web app packaged (e.g., WAR, JAR, ZIP, or a simple static site)
  • A GitHub repository (for automated deployment)

Deployment

  • Create Your Azure App Service — Create an App Service in the Azure portal or through CLI
# Variables
RG_NAME=my-webapp-rg
APP_NAME=my-webapp-app
PLAN_NAME=my-appservice-plan 
REGION=eastus

# Create Resource Group
az group create --name $RG_NAME --location $REGION

# Create App Service plan
## An Azure App Service plan defines a set of compute resources for a web app to run.
## more information -> https://learn.microsoft.com/en-us/azure/app-service/overview-hosting-plans
az appservice plan create \
  --name $PLAN_NAME \
  --resource-group $RG_NAME \
  --sku B1 \ # <-- customize this as per need
  --is-linux # <-- customize this as per need

# Create Web App
az webapp create \
  --name $APP_NAME \
  --resource-group $RG_NAME \
  --plan $PLAN_NAME \
  --runtime "JAVA:21-java21" # <-- customize this as per need
  • Deploy Manually (CLI or Git) — If you’ve built a Java app (WAR/JAR/ZIP), deploy it like this:
# Option A, CLI in SRC dir
az webapp deploy \
  --src-path helloworld.war \
  --resource-group $RG_NAME \
  --name $APP_NAME

# Option B, push to Git
# Configure deployment source
az webapp deployment source config-local-git \
  --name $APP_NAME \
  --resource-group $RG_NAME

# Add the remote URL and push
git remote add azure https://<generated_git_url>
git push azure main
  • Automated Deployment with CI/CD tools — You can set up a CI/CD pipeline so every push to main automatically deploys your app. Here’s a sample GitHub Actions workflow:
name: Deploy to Azure App Service

on:
  push:
    branches: [ main ]
    paths:
    - 'target/**'
pull_request:
    branches: [ main ]
    paths:
    - 'target/**'

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v4

    - name: Set up Java
      uses: actions/setup-java@v4
      with:
        distribution: 'temurin'
        java-version: '21'

    - name: Build with Maven
      run: mvn clean package

    - name: Upload WAR file as artifact 
      uses: actions/upload-artifact@v3
      with:
        name: war-artifact
        path: target/helloworld.war


    - name: Deploy to Azure Web App
      uses: azure/webapps-deploy@v3
      with:
        app-name: ${{ secrets.AZURE_WEBAPP_NAME }}
        publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
        package: target/helloworld.war

You can get the AZURE_WEBAPP_PUBLISH_PROFILE from the Azure Portal → App Service → "Get publish profile", and store it as a GitHub secret.

Secrets Management

Use GitHub Actions secrets to store sensitive values:

AZURE_WEBAPP_NAME -> Your web app name

AZURE_WEBAPP_PUBLISH_PROFILE-> Auto-deploy credential

No credentials should be hardcoded in your pipeline — everything runs securely from GitHub’s hosted runners.

Custom Domain & SSL (Optional)

You can configure a custom domain via Azure Portal and validate it with a CNAME or TXT record. Azure will issue and manage the SSL certificate automatically if you choose CNAME validation.

Monitor logs

az webapp log tail \
  --name $APP_NAME \
  --resource-group $RG_NAME

You can also enable diagnostic logging and stream logs in real-time.

Final Thoughts

Azure App Service is ideal for fast deployments without worrying about servers. By combining it with GitHub Actions, I was able to:

  • Automate builds and deployments.
  • Ensure reproducibility and zero-downtime rollouts.
  • Maintain security and separation of concerns.

If you’re exploring App Service or just getting started with Azure, this workflow will save you time and set you up for scalable success.

I hope this guide helps you streamline your Java deployments to Azure. If you found it useful, consider sharing or bookmarking it — and let me know in the comments how your experience went!

🔗 I also wrote a related post on deploying containerized apps using Azure Container Apps (with scale-to-zero and Docker builds). Check it out here: https://medium.com/@siddheshnikam8/how-to-deploy-a-containerized-app-to-azure-container-apps-with-ci-cd-b5e25e0291f3


메타데이터
post_id
4522eb2a8b1c
slug
how-to-deploy-a-web-application-to-azure-app-service-with-ci-cd-automation-4522eb2a8b1c
url
https://medium.com/@siddheshnikam8/how-to-deploy-a-web-application-to-azure-app-service-with-ci-cd-automation-4522eb2a8b1c
canonical_url
https://medium.com/@siddheshnikam8/how-to-deploy-a-web-application-to-azure-app-service-with-ci-cd-automation-4522eb2a8b1c
author_url
https://medium.com/@siddheshnikam8
status
ok
fetched_at
2026-08-08 14:52:09