02 - First Deploy (Consumption)¶
Provision a Consumption (Y1) function app and deploy the PowerShell project you built in step 01.
Prerequisites¶
- Completed 01 - Run Locally
- Signed in with
az login
Steps¶
Step 1 - Set variables¶
Step 2 - Create the resource group and storage¶
az group create --name $RG --location $LOCATION
az storage account create \
--name $STORAGE_NAME \
--resource-group $RG \
--location $LOCATION \
--sku Standard_LRS
az group create | Create the resource group that holds the tutorial resources. | | --name | Name of the resource group. | | --location | Azure region for the resource group. | | az storage account create | Create the storage account the function app requires. | | --name | Name of the storage account. | | --resource-group | Resource group that contains the storage account. | | --location | Azure region for the storage account. | | --sku | Storage replication SKU (Standard_LRS = locally redundant). | Step 3 - Create the function app¶
az functionapp create \
--name $APP_NAME \
--resource-group $RG \
--storage-account $STORAGE_NAME \
--consumption-plan-location $LOCATION \
--runtime powershell \
--runtime-version 7.4 \
--functions-version 4 \
--os-type Windows
az functionapp create | Create the function app on a Consumption plan. | | --name | Name of the function app. | | --resource-group | Resource group that contains the function app. | | --storage-account | Storage account backing the function app. | | --consumption-plan-location | Region for the auto-created Consumption plan. | | --runtime | Language runtime stack (powershell). | | --runtime-version | PowerShell runtime version. | | --functions-version | Azure Functions runtime major version. | | --os-type | Operating system for the app (Windows). | Step 4 - Deploy the code¶
Verification¶
Returns Hello, Azure.
Next Steps¶
Your app is live. Next, manage its configuration and secrets.
Next: 03 - Configuration
See Also¶
- Tutorial Overview & Plan Chooser
- PowerShell Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index
Sources¶
- PowerShell developer reference (Microsoft Learn)
- Azure Functions Consumption plan (Microsoft Learn)
- Run Functions locally with Core Tools (Microsoft Learn)
Legacy hosting path
Consumption plan (Y1) content is provided for existing workloads. For most new serverless applications, prefer Flex Consumption.