How to create an Azure App Service using CLI
Tags: beginners, tutorial, devops, cloud
Published: 2024-05-26 14:21:16

##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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chws2h6wtjpolu8k30k2.png)

Step 2
Login to your Azure Account by typing 'az login'
![Login](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6n4h0aul2a1yvalcse9w.png)

Step 3
Click enter to sign in into Azure portal
![enter](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1hbx7ax7zof32ai3pvbr.png)

Step 4
Sign in, let it run and click enter after running
![output](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jcxno938rlatd7rmm3x9.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qekq88llexrey8xtyvtv.png)

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](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k044cnkukl17biylep65.png)

Step7
Create a webapp using "az webapp create --name NAME --resource group NAME --plan NAME"
![webapp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/izit1ha4o4met8aywvmc.png)

Step 8
Go to Azure Portal to confirm 
On the Azure portal search for App Service
![app service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rje9ea6slziag56ln5dq.png)

Step 9
Click on the webapp
![firstone](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w6y9f1t8wtyrwdsqcizm.png)

Step 10
On the left pane search bar, search and click Advance tools
![Advance tools](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6scxqur65wmibhcer3v0.png)

Step 11
Click on go
![go](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4x5nxxt2hsyos31rgt4y.png)

Note: another page will be opend on your browser
![new page](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b768z4hgrdg3uxrz82nd.png)

Step 12
Click on Debug Console
![Debug Console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6blsdd2cgn7a890ii4bo.png)

Step 13
Click on CMD
![CMD](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3yqrndbc84cv5j5t7me3.png)

Step 14
Click on Site
![Site](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fs3fj5873psi2465uv4.png)

Step 15
Click on wwwroot
![root](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tce7j93mn40kqmbe294y.png)

Step 16
Click on the pencil icon to edit
![edit](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q2aerx9a63gpryasg0ov.png)

Step 17
Enter your desired code and click save
![code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kw0duz0pgc8jmkdrskli.png)

Step 18
Go to your Azure Portal, on your webapp page click on overview
![overview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ro1hroiw46foyj5ouur6.png)

Step 18
Copy the Default Domain
![Domain](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t0yh6ivj4rukeyhtqx7k.png)

Step 19 (Final Step)
Paste the copied Domain on a new tab in your browser 
![final](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g2io5b0ahocjpglf0llq.png)

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.