Skip to main content

Command Palette

Search for a command to run...

From Zero to URL: Deploying a Production-Ready Azure Web App with ARM Templates + Azure CLI (Beginner-Friendly Guide)

Updated
4 min read
From Zero to URL: Deploying a Production-Ready Azure Web App with ARM Templates + Azure CLI (Beginner-Friendly Guide)
I

I'm Iniobong Ema, a Cloud and DevOps Engineer, I'm passionate about automation, pipelines and building scalable systems. I document my journey, share tutorials and explore modern tech solutions-one experiment at a time. From Code to Cloud: My DevOps Journey. My contact information: Phone number: 08027604029 Gmail Address: iniema2025@gmail.com, iniakan4real2017@gmail.com

If you’re a Cloud/DevOps engineer (or you’re becoming one), learning Infrastructure as Code (IaC) is a must. In this guide, you’ll deploy an Azure Web App (App Service) using an ARM template and the Azure CLI—step by step—so your deployment is repeatable, version-controlled, and easy to automate later in CI/CD.

What You’ll Build (In Simple Terms)

You will create and deploy:

  • A Resource Group

  • An App Service Plan (the compute hosting plan)

  • A Web App (App Service)

  • An optional deployment step for your web content

Prerequisites

  • An Azure subscription

  • Azure CLI installed

  • A terminal (Windows PowerShell, CMD, or Git Bash)

A: Check CLI: Go to your terminal, type 'az version' to check if CLI is installed

This shows installation was successful.

B: Type 'az login'

Step 1: Create a Project Folder

Create a folder for your deployment files: On the terminal type 'mkdir azure-webapp-arm-cli cd azure-webapp-arm-cli' and enter

Step 2: Create the ARM Template (template.json)

Create a file named template.json and paste this ARM template (it deploys an App Service Plan + Web App):

Step 3: Create Parameters File (parameters.json)

Create parameters.json: I will replace this with something unique. i will change webapp-beginner-demo-12345 with something unique like iniobong-webapp-2026-0302-xyz

Step 4: Create a Resource Group

Pick a region close to you. Example: West Europe (or choose UK South, South Africa North, etc.) paste this 'az group create --name rg-webapp-arm-demo --location westeurope'

Before deploying, validate your template: paste this az deployment group validate
az deployment group validate --resource-group rg-webapp-arm-demo --template-file (Resolve-Path .\template.json) --parameters ("@" + (Resolve-Path .\parameters.json))

Still validate with this to be sure 'az deployment group validate --resource-group rg-webapp-arm-demo --template-file (Resolve-Path .\template.json) --parameters ("@" + (Resolve-Path .\parameters.json))

Quick debug checks (make sure you’re in the right folder)

Run: Test-Path .\template.json Test-Path .\parameters.json

They should both return True as shown above. If validation passes, you’re ready to deploy.

Step 6: Deploy the ARM Template with Azure CLI

Deploy the ARM template

Run: az deployment group create --resource-group rg-webapp-arm-demo --template-file .\template.json --parameters "@parameters.json"

Step 7: Confirm the Web App exists and get the URL

Replace the name with your actual web app name (from parameters.json):

Open in browser:

  • https://iniobong-webapp-2026-0302-xyz.azurewebsites.net

Step 8: Deploy a simple web page (ZIP Deploy)

Create a small site

Run: mkdir site notepad .\site\index.html

Paste this into index.html and save:

B: Zip the site folder

Run: Compress-Archive -Path .\site* -DestinationPath .\site.zip -Force

C: Deploy the ZIP to your Web App

Run: az webapp deployment source config-zip --resource-group rg-webapp-arm-demo --name iniobong-webapp-2026-0302-xyz --src .\site.zip

Step 9: Repeat steps B and C

The viewed page using my displayed name

Clean up (avoid charges)

If you’re done testing, Run: az group delete --name rg-webapp-arm-demo --yes --no-wait'

Conclusion

This lab successfully demonstrated how a web application can be deployed on Microsoft Azure using Infrastructure as Code (IaC) with an ARM template and automated through the Azure CLI. By first validating the ARM template, the lab ensured that the infrastructure definition was syntactically and logically correct before deployment, reducing the risk of runtime errors. The successful creation of the resource group, App Service Plan, and Web App confirms the effectiveness of ARM templates in providing a repeatable, consistent, and scalable approach to cloud resource provisioning.

Furthermore, the deployment of web content using ZIP deployment illustrated how application code and infrastructure can work together within a DevOps workflow. The lab highlighted practical considerations such as command-line environment differences, file path handling, and the importance of proper validation and verification steps. Overall, this exercise reinforces best practices in modern cloud engineering—automation, consistency, and reliability—while providing a strong foundation for advancing to CI/CD pipelines, monitoring, and more complex Azure deployments