How to create an Azure web app using PowerShell

In this azure tutorial, we will discuss how to create an Azure web app from the Azure Portal. Also, we will discuss how to create an Azure web app using PowerShell and Azure web app pricing.

Create an Azure web app from Azure Portal

Here, we will discuss how to setup azure web app from the Azure portal.

Azure Web App is an excellent service in Azure and it is one of the cheap service in market now.

One of the advantage of the Azure App is it supports different languages like java, .net, PHP etc.

There are various benefits of using Azure app Service

  • Supports multiple languages like Java, .Net, PHP, etc
  • It supports continuous deployment and integration
  • High availability and scalability support.
  • Supports other platform integration.

Follow the below steps to create an Azure web App in Azure portal.

Step- 1:

Login to https://portal.azure.com/

Step- 2:

Click on the + Create a resource button from the left navigation.

How to create an Azure web app

Or for the same option, you can click on the + Create a resource button from the Azure services section.

How to create a web app in Azure

Step-3:

In the New page, search for the Web app now click on the search result Web app.

How to configure a web app in Azure

Now you will see the below screen

How to configure a web app in Azure

Now for the same option, you can search for App services after login to the Azure portal.

How to configure a web app in Azure

Click on the search result App Services and click on the Add button.

How to add a web app in Azure

Step-5:

In the web app window, fill the below details

  • Subscription: Select your subscription details.
  • Resource Group: You can select the existing resource group or you can create a new one also by clicking on the Create new link.
  • Name: You need to provide a name for the web app.
  • Publish: You can select the Code option here.
  • Runtime stack: I choose here .Net core 3.1 (LTS). You can also choose a different one.
  • Operating System: You can choose either Linux or Windows based on your need.
  • Region: You can select your region.
  • Linux plan (Central US): Based on your region and other value selection, this field will auto-populate or you can also create a new one by clicking on the Create new link.
  • SKU and size: I change the size because there is a free offer (Free offer 1 GB Memory) from Microsoft for Linux operating system.
How do I make an Azure web app?
Azure web app

To change the Sku and size, click on the Change size link .

In the Spec Picker window, click on Dev/Test section, choose F1 (1 GB memory, 60 minutes/day compute free) but you can also choose on your choice based on your requirement, click on the Apply button.

Now go to the Monitoring tab by clicking on the Next : Monitoring > button.

create a web app in Azure portal

Step-6:

In the Monitoring tab, No need to change anything. Keep the Enable Application Insights option as No.

Now click on the Next : Tags > button to go to the Tags tab.

Microsoft Azure web app pricing

Step-7:

In the Tags window, keep the default option as it is and then click on the Next:Review + Create button.

How to create an Azure web app

Step-8:

Now click on the Create to create an Azure web app.

How to create a web application in Azure

Now you can see it is in progress to create the web app in Azure

How to create a web application in Azure

Deployment is completed now. Click on the Go to resource button to see the web app.

How to add a web application in Azure

See Here it is, It created successfully.

How to deploy a web application in Azure

How to create an Azure web app using PowerShell?

Now it is time to see how to create an Azure web app using PowerShell?

1- Need to specify the web app name and the Region using PowerShell. Use the below PowerShell window or PowerShell ISE.

#Specify the Web app Name and Region
$mywebapp = "MyNewWebApp468"  
$myloc = "Central US"  
$myAppPlan = "MyWebApps"
How to create an Azure web app using PowerShell

2- You can create a resource group or you can use the existing resource group. Use the below cmdlet to create the resource group using PowerShell

New-AzureRmResourceGroup -Name mynewupdtrsggroup -Location $myloc
Create an Azure web app using PowerShell

3- You can create an App Service plan using the free tier

New-AzureRmAppServicePlan -Name $myAppPlan -Location $myloc -ResourceGroupName mynewupdtrsggroup -Tier Free
How to set an Azure web app using PowerShell

4- Now we need to create the web app using the below PowerShell cmdlet.

New-AzureRmWebApp -Name $mywebapp -Location $myloc -AppServicePlan $myAppPlan -ResourceGroupName mynewupdtrsggroup 
create an Azure web app using PowerShell

5- Now run the below complete script to create the web app in Azure

$mywebapp = "MyNewWebApp468"  
$myloc = "Central US"  
$myAppPlan = "MyWebApps"
New-AzureRmResourceGroup -Name mynewupdtrsggroup -Location $myloc
New-AzureRmAppServicePlan -Name $myAppPlan -Location $myloc -ResourceGroupName mynewupdtrsggroup -Tier Free
New-AzureRmWebApp -Name $mywebapp -Location $myloc -AppServicePlan $myAppPlan -ResourceGroupName mynewupdtrsggroup 
How to set  an Azure web app using PowerShell

This is how we can create Azure web app using PowerShell.

Azure web app pricing

Below are few pricing details for Azure web App service

FREESHAREDEnvironment for dev/testBASICDedicated environment for dev/testSTANDARDRun production workloadsPREMIUMEnhanced performance and scaleISOLATEDHigh-Performance, Security and Isolation
Web, mobile or API apps10100No limitNo limitNo limitNo limit
Disk space1 GB1 GB10 GB50 GB250 GB1 TB
Custom domainSupportedSupportedSupportedSupportedSupported
PriceFree₹0.860/hour₹4.958/hour₹6.610/hour₹13.220/hour₹26.439/hour

For more details on Azure web app pricing you can follow the official website.

You may like following Azure tutorials:

Conclusion

In this Azure tutorial, we will discuss how to create an Azure web app from the Azure portal as well as how to create an Azure web app using PowerShell. Also, we discussed on Azure web app pricing.

Leave a Comment