Deploying Azure Web App using CLI
Published: 2023-09-10 14:31:32

**What is Azure App Service?**
Azure App Service is a Microsoft Azure Platform-as-a-Service (PaaS) service that allows developers to effortlessly design, distribute, and manage online and mobile applications. It includes automatic scaling, continuous deployment, and built-in support for popular programming languages.

Web applications are built using programming languages such as **HTML, CSS,** and **JavaScript** for the frontend, and languages like **Python, Ruby, Java, or PHP** for the backend. They can offer a wide range of functionalities, such as online shopping, social media, email services, productivity tools, and more. These applications are designed to be accessible from various devices, including desktop computers, laptops, tablets, and smartphones.

**Let's get started please.**

Ensure you have the Azure CLI installed on your system. You can download [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli), select your system operating system from the left pan and follow with the link. You can confirm if Azure CLI is installed by using the command az version from your CLI

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zgybf61g18vcwfaejq57.png)

**Log into the Azure CLI.**

From the command line (CLI) use the command az login. It will prompt you to select the Azure account you wish to log into. Remember you must have an Azure account and a valid subscription.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2q44akg43hbuq4t3dw4.png)

Go to your default browser, then select your active account to login.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d91gr80dkost8un24d0f.png)

You will get this message, go back to your command line interface (CLI), press enter.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/npi489980espmy66db5i.png)

After logging into the Azure account, you can confirm your subscription name and your Azure user account details.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qs4moske4v4xqg0tawbl.png)

**Create a new Resource group or login to an existing one in your subscription**

It is always best practice to have a resource group for your work. You can use an existing one or create a new one. Let us create a new one via the CLI.

The syntax for the command to create a Resource group is

az group create --name <resource group name> --location <region>

az group create --name kenRG --location westeurope

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/virm8ivxq1odmsyko7jx.png)

We have our kenRG resource group created successfully.

**Let us create an App service plan**

Now to create our app service. Use the command syntax

az appservice plan create --name <name of appservice> --resource-group <name of resource group>

az appservice plan create --name kenapp --resource-group kenRG

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/96u8o7i7dbrel34a5yv4.png)

The app service plan called kenapp is created.

**To create a web app**

The command syntax is

az webapp create --name <name of webapp> --resource-group <resource-group name> --plan <App service plan name>

az webapp create --name kenwebapp --resource-group kenRG --plan kenapp

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hxkedyx1ep59mw8naqgv.png)

**Access your web app**

To access your web app you need to enter the URL syntax to your browser

https://<name of webapp>.azurewebsites.net

kenwebapp.azurewebsites.net

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/672duvt7ggmpsi1mqro5.png)

As you can see your web app is running and only awaiting your content.

**SUMMARY:**

We were able to successfully explore the following Azure Cloud journey and I am confident that you can navigate on your own through the above guide made easy in the areas below;

1). Create a Resource Group.

2). Create an Azure Apps Service Plan.

3). Create a Web App.

4). Launch the created Web App.

_Thank you for reading my article till the end. I hope you learned something special today. If you enjoyed this article, then please share to your friends and if you have suggestions or thoughts to share with me then please write in the comment box._