DEV Community

Cover image for Deploying Azure Web App using CLI
Kehinde Oloye
Kehinde Oloye

Posted on

Deploying Azure Web App using CLI

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, 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

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

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

Image description

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

Image description

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

Image description

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 --location

az group create --name kenRG --location westeurope

Image description

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 --resource-group

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

Image description

The app service plan called kenapp is created.

To create a web app

The command syntax is

az webapp create --name --resource-group --plan

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

Image description

Access your web app

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

https://.azurewebsites.net

kenwebapp.azurewebsites.net

Image description

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.

Top comments (0)