DEV Community

Cover image for How to create an Azure App Service using CLI
Adedapo
Adedapo

Posted on

How to create an Azure App Service using CLI

Azure App Service

Azure App Service is a fully managed platform-as-a-service (PaaS) offering from Microsoft Azure designed to host web applications, RESTful APIs, and mobile backends. It allows developers to build, deploy, and scale web apps quickly without managing the underlying infrastructure.

Steps to create Azure App Service

Step 1
Open your terminal and install Azure CLI (if not installed)
Note: to get Azure CLI search for it on Google.
In this case i wont install CLI on my terminal, I already have it
Terminal

Step 2
Login to your Azure Account by typing 'az login'
Login

Step 3
Click enter to sign in into Azure portal
enter

Step 4
Sign in, let it run and click enter after running
output

Step 5
Create a Resource Group using "az group create --name NAME --location eastus"
Note: 'NAME' should be the one you wish to give your resource group
resource group

Step 6
Create an App Service Plan using "az appservice plan create -- name NAME --resource-group NAME" (resource group name i.e FirstOne)
app service

Step7
Create a webapp using "az webapp create --name NAME --resource group NAME --plan NAME"
webapp

Step 8
Go to Azure Portal to confirm
On the Azure portal search for App Service
app service

Step 9
Click on the webapp
firstone

Step 10
On the left pane search bar, search and click Advance tools
Advance tools

Step 11
Click on go
go

Note: another page will be opend on your browser
new page

Step 12
Click on Debug Console
Debug Console

Step 13
Click on CMD
CMD

Step 14
Click on Site
Site

Step 15
Click on wwwroot
root

Step 16
Click on the pencil icon to edit
edit

Step 17
Enter your desired code and click save
code

Step 18
Go to your Azure Portal, on your webapp page click on overview
overview

Step 18
Copy the Default Domain
Domain

Step 19 (Final Step)
Paste the copied Domain on a new tab in your browser
final

You have just create a Azure WebApp using Azure CLI.
In sumamary, Using Azure CLI to create and manage web apps simplifies the deployment process by allowing you to handle everything from the command line. This approach is efficient for automating deployment tasks, integrating with CI/CD pipelines, and managing web applications programmatically.

Top comments (0)