How to script an Azure Function app creation?TypeScript
For creating an Azure Function App, you will primarily need to work with Azure App Service Plan and Function App resources. The App Service Plan represents the resource where the Function App will run and it determines the cost of your function. The Function App resource represents the Azure Function itself.
This code illustrates how to create an Azure Function app:
ResourceGroup: represents the Resource Group in which you will create resources. Location is necessary for creating the Resource Group.
storage.Account: Azure requires an account where it can store files utilized by the function. Here, LRS (Locally redundant storage) and 'Standard' tier are used for the sake of affordability.
appservice.Plan: This represents the plan in which your function app will run. Use "FunctionApp" as the kind. Use tier "Dynamic" and size "Y1" for a consumption plan, which means you only get billed for executions rather than for having your func up.
appservice.FunctionApp: This is your actual function app. You need to supply it with a connection string that it can use to access your storage account.
The output of the Pulumi up command will include function app's default hostname. Accessing this in a browser will display the default Azure Function App welcome page.