DEV Community

Cover image for Step-by-step guided tools needed to create an Azure App Service Using Power Shell
Ikechukwu Kelechi Alexander
Ikechukwu Kelechi Alexander

Posted on

Step-by-step guided tools needed to create an Azure App Service Using Power Shell

Prerequisites:

Before we create our resource group let us Download Azure CLI just type Azure CLI on your browser or go to https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli else choose your Operating System and the Bits

  • Azure CLI must be downloaded on your PC CLI
  • Azure Subscription: You'll need an active Azure subscription to create resources.
  • Power Shell is needed to carry out assignment
Without further ado, let's begin!
Enter fullscreen mode Exit fullscreen mode

1. Open your Power Shell as Administrator
PS

2. Log in to Azure Portal
Login

What is Azure App Service?
Azure App Service is a Platform as a Service (PaaS) offering in Azure that hides infrastructure maintenance and allows developers to concentrate on application development. Furthermore, it will address scalability, availability, security, patching, and other issues.

Requirements to create an App Service application in Azure

  • A resource group
  • An App Service Plan
  • The webapp itself

3. The resource Group
This is where everything about the app service project will be stored, and when the project is over, if we delete the resource group, everything is deleted. We can create one with the command below using Power Shell.
RG
az login --tenant 2fa4162f-d4fa-4b87-abdc-9967dd81ffa3
az group create --name YesAppRG --location eastus

4. Create App Service Plan
App Service Plan
Input this code: az appservice plan create --name YesAppPlan --resource-group YesAppRG

When you create an App Service plan in a certain region (for example, West Europe), a set of compute resources is created for that plan in that region. Whatever apps you put into this App Service plan run on these compute resources as defined by your App Service plan. Each App Service plan defines:

  • Operating System (Windows, Linux)
  • Region (West US, East US, and so on)
  • Number of VM instances
  • Size of VM instances (Small, Medium, Large)
  • Pricing tier (Free, Shared, Basic, Standard, Premium, PremiumV2, PremiumV3, Isolated, IsolatedV2)

5. Create The Webapp
az webapp create --name YesAppServiceWebApp --resource-group YesAppRG --plan YesAppPlan

WebApp 1

WebApp 2

WebApp 3

Let's Login to Azure Portal to confirm if Resource Group, The Plan and WebApp has been created!
Enter fullscreen mode Exit fullscreen mode

3in1

Copy the link to browser
Links

Confirmation of empty page waiting for content
Empty Page

Locate Advanced Tools the left-corner search bar
Select Go
Image description

  • Click on Debug Console
  • Select CMD Debug Console + CMD

Click on Site
Site

Click on wwwroot
wwwroot

Click on the Pen icon to edit the content
Html Edit

Paste the Script
Code

Refresh or Copy the WebApp link
Image description

Congratulations for completing this task!

Bye for now!
Enter fullscreen mode Exit fullscreen mode

Top comments (3)

Collapse
 
tjasper profile image
Oluwaloseyi Oluwatofunmi Emmanuel

Nice one!

Collapse
 
realcloudprojects profile image
Skill Schule

Welldone!

Collapse
 
henry_onyenibeji_96799b20 profile image
Henry Onyenibeji

Great work IK, nice to know you are taking same path