HOW TO CREATE A WEB APPLICATIONS USING AZURE CLI: Step-by-Step Guide.

javaboy

Aluko Adeleke

Posted on March 14, 2024

HOW TO CREATE A WEB APPLICATIONS USING AZURE CLI: Step-by-Step Guide.

In this article, you will learn how to implement Azure CLI command lines to build ,deploy and scale web app and API.
The followings are the prerequisites that must be enabled on your system.
Prerequisites
A Microsoft Azure Account with Active Subscriptions.
Azure CLI installed on your computer.

**Follow these steps to create an Azure App Service using Azure CLI

  1. Login to Azure Account from Windows powershell on your computer by typing AZ LOGIN and press enter as demonstrated below

Image description

Launching this command will definately redirect you to a web page requesting you to select an active microsoft azure account

Image description
Upon successful login , you will be asked to close the web page and continue to the powershell page where you will see the detail login to your azure account

Image description

You will receive the below replies upon successful login

Image description

  1. Create a resource group This resource group will house your web app(s) and other resources put together in creating you app. The syntax for creating a resource group

az group create --name --location

Once you issue the command line ,an instant copy of the resource group is created in Azure which comes with an instant reply in the CLI with message "Succeeded"

Image description

  1. Create an app service plan App service plan is more like an operating system that hosts your web application that provides the infrastructure and resources required to run, or scale your apps. The syntax for this command

az appservice plan create --name --resource-group
Launching the command line below

Image description
You will receive a succeed message indicating that you service plan has been created.

  1. Create your webb app The syntax to creating a web application

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

Image description

  1. Verify that the app service create is running two way to verify that your app is running are
    1. CLI Command az webapp show --name --resource-group
    2. Login into Microsoft Azure account where the service are created.

we successfully create an Azure App Service lekewebapp using Azure CLI. With Azure App Service, you can easily deploy and scale your web apps and APIs in the cloud
Before you can deploy this app, we must configure a deployment for the app just created and create a PUSH.
All these can be achieve in GITHUB.
Ensure you create an account with GITHUB.
created a repository and an index file for your web application. Your index file must have been created using Git BASH and push to GITHUB. This is yet another prerequisite to creating a web application done by a developer.
After successful creation of a repository, go to the code section,Copy the URL of the code .

Image description

6 Configure The Deployment Source of Your Web Application
The syntax to deploy your app

az webapp deployment source config --name --resource-group --repo-url --branch master --manual-integration

Lets go ahead and launch the deployment

Image description
You will get a feedbacks below upon successful deployment

Image description

![Image description](https://dev-to-
Image description

All Messages displayed while creating your web app can be viewed here
Image description

A deployment slot is a version of your web App that developer/cloud engineers use to test and make changes before deploying them to your production environment.

Cloud engineers uses deployment slot to add new features to there website without causing any downtime.

a) To create a deployment slot, go to your Web App page and scroll down to the left. Click on the deployment slot.

b) On the deployment slot page, we can see that our web app is in the production state running. The traffic is also 100%

c) To add a slot, click on +add slot

Image description

💖 💪 🙅 🚩
javaboy
Aluko Adeleke

Posted on March 14, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related