Question:
Your team is working on an application that requires data to be processed immediately. You decide Azure Functions would be an excellent fit for this application. Provide a list of Azure CLI commands you would execute to set up the function app from the ground up, given that there are no pre-existing resources or configurations.
Answer:
"data to be processed immediately" requires pre-warmed instances, supported in Premium plan.
# Variables
resourceGroupName="MyResourceGroup"
storageName="mystorageaccount"
planName="MyPremiumPlan"
functionAppName="myfunctionapppremium"
location="westus2"
# Create a resource group
az group create --name $resourceGroupName --location $location
# Create an Azure Storage Account
az storage account create --name $storageName --location $location --resource-group $resourceGroupName --sku Standard_LRS
# Create a premium plan
az functionapp plan create --name $planName --resource-group $resourceGroupName --location $location --sku EP1
# Create a function app with the premium plan
az functionapp create --resource-group $resourceGroupName --plan $planName --name $functionAppName --storage-account $storageName --runtime node --functions-version 3