The goal of this lab is to create the Azure resources which are required to run (and monitor) our Function App.
You'll need an Azure account (see the prerequisites) in order to complete this lab.
Up to now we've ran our Function App locally using an emulated storage account. In order to run the application in Azure we need the following:
- A resource group, which is a logical container for our Azure resources
- A storage account, which is used to store our Function App files and is also used by Durable Functions.
- A Function App resource
- Optional but highly recommended: Application Insights, which is used for monitoring and diagnosing our application.
There are many differnt ways to create Azure resources; via the portal, the Azure CLI, ARM templates, and many cloud provision tools.
Here I'll show some samples how the Azure CLI can be used. But feel free to use the tools which work best for you.
In a command prompt type: az login
in order to login with your Azure credentials.
In the examples below I'm using a Powershell specific syntax for variables (e.g.
$location
) which are used in arguments. You need to change the syntax of these variables when we're not using Powershell.
In order to see what options are available for a given CLI command use the
-h
argument, such asaz group -h
to see the available subcommands for resource groups.
Once logged in proceed with the following commands:
az account list
az account set -s <id>
$location="westeurope"
$rgname="neo-processing-rg"
az group create --name $rgname --location $location --tags type=labs
$stname="neoprocessingst"
az storage account create --name $stname --resource-group $rgname --location $location --sku Standard_LRS --kind StorageV2 --access-tier Hot
Application Insights is not available by default in the Azure CLI and needs to be added first:
az extension add --name application-insights
$ainame="neo-processing-ai"
az monitor app-insights component create --app $ainame --location $location --application-type web --kind web --resource-group $rgname
$funcAppName="neo-processing-fa"
az functionapp create --name $funcAppName --resource-group $rgname --consumption-plan-location $location --storage-account $stname --app-insights $ainame --runtime dotnet --os-type Windows
Inspect the above CLI command. What can you tell about the configuration of the Function App?
Continue to the next lab to publish our Function App to Azure.