Azure HTTP PowerShell Function App

This article will give you a basic idea about how to create Azure Function App to run powershell Scripts and return output in required format.
 
To create a Function App you should have an Azure subscription (Free or Paid).
 
Login to Azure Portal.
 
After logging on to the landing page, go to All Resources or More Services (I selected more services).
 
Azure HTTP PowerShell Function App
 
Select Function App.
 
Azure HTTP PowerShell Function App
 
Click on Add, Function App Details
 
1.
Select Subscription: (If you are using free trail the select Free Trial)
 Azure HTTP PowerShell Function App
2.
Select Resource Group (If already created select Existing or create new one)
3.
Give name to Function App (In our case I am giving name as “AZPnPSP”
4.
Select Publish “Code”
5.
Select Runtime Stack “.NET Core”
6.
Select Version “3.1”
7.
Select Region (Region near to your locations)
 
Click on Review + Create. On Review page review all of the information and click on Create.
 
It will take about 5 minutes for deployment and creation of Function App.
 
Click on Go to Resource.
 
Azure HTTP PowerShell Function App
 
Click on Classic Function App Management
 
Azure HTTP PowerShell Function App
 
First of all we need to update settings of Function App, go to Platform Features then click on Function App Settings.
 
Azure HTTP PowerShell Function AppAzure HTTP PowerShell Function App
 
Set Runtime version to 1, it will take 30-60 seconds to update.
 
Azure HTTP PowerShell Function App
 
Click on Add New Function then select “create your own custom function”
 
Azure HTTP PowerShell Function AppAzure HTTP PowerShell Function App
 
On thw new Create your own custom function page enable “Experimental Language Support”.
 
Azure HTTP PowerShell Function App
 
Under HTTP trigger function to select PowerShell language to create new function.
 
Azure HTTP PowerShell Function App
 
On Create New Function screen specify Function name, Language to PowerShell, Authorization level to “Function”. Click on Create.
 
Azure HTTP PowerShell Function App
 
Once Function App is created, by default code is available which reads input from body, and print output.
 
Azure HTTP PowerShell Function App
 
Get Function URL and use it in your application.
 
Azure HTTP PowerShell Function App