Skip to content

Commit 81ff8f2

Browse files
committed
Complete ARM quickstart update to Flex + ROPC
1 parent 8fb6dd9 commit 81ff8f2

6 files changed

+200
-97
lines changed

articles/azure-functions/functions-create-first-function-bicep.md

Lines changed: 10 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Create your function app resources in Azure using Bicep
33
description: Create and deploy to Azure a simple HTTP triggered serverless function using Bicep.
44
author: ggailey777
55
ms.author: glenga
6-
ms.date: 03/11/2025
6+
ms.date: 03/17/2025
77
ms.topic: quickstart
88
ms.service: azure-functions
99
zone_pivot_groups: programming-languages-set-functions
@@ -32,27 +32,19 @@ The Bicep file used in this quickstart is from an [Azure Quickstart Template](ht
3232

3333
:::code language="bicep" source="~/quickstart-templates/quickstarts/microsoft.web/function-app-flex-managed-identities/main.bicep":::
3434

35-
You use this file to create these Azure resources:
35+
This deployment file creates these Azure resources needed by a function app that securely connects to Azure services:
3636

37-
+ [**microsoft.Insights/components**](/azure/templates/microsoft.insights/components): creates an Application Insights instance for monitoring your app.
38-
+ [**Microsoft.OperationalInsights/workspaces**](/azure/templates/microsoft.operationalinsights/workspaces): creates a workspace required by Application Insights.
39-
+ [**Microsoft.Storage/storageAccounts**](/azure/templates/microsoft.storage/storageaccounts): create an Azure Storage account, which is required by Functions.
40-
+ [**Microsoft.Web/serverfarms**](/azure/templates/microsoft.web/serverfarms): create a serverless Flex Consumption hosting plan for the function app.
41-
+ [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites): create a function app.
37+
[!INCLUDE [functions-azure-resources-list](../../includes/functions-azure-resources-list.md)]
4238

43-
44-
Deployment considerations:
45-
46-
+ The storage account is used to store important app data, including the application code deployment package. This deployment creates a storage account that is accessed using Microsoft Entra ID authentication and managed identities. Identity access is granted on a least-permissions basis.
47-
+ The Bicep file defaults to creating a C# app that uses .NET 8 in an isolated process. For other languages, use the `functionAppRuntime` and `functionAppRuntimeVersion` parameters to specify the specific language and version on which to run your app. Make sure to select your programming language at the [top](#top) of the article.
39+
[!INCLUDE [functions-deployment-considerations-infra](../../includes/functions-deployment-considerations-infra.md)]
4840

4941
## Deploy the Bicep file
5042

5143
1. Save the Bicep file as **main.bicep** to your local computer.
5244

5345
1. Deploy the Bicep file using either Azure CLI or Azure PowerShell.
5446

55-
### [CLI](#tab/CLI)
47+
### [Azure CLI](#tab/azure-cli)
5648
::: zone pivot="programming-language-csharp"
5749
```azurecli
5850
az group create --name exampleRG --location <SUPPORTED_REGION>
@@ -83,7 +75,7 @@ Deployment considerations:
8375
az deployment group create --resource-group exampleRG --template-file main.bicep --parameters functionAppRuntime=powerShell functionAppRuntimeVersion=7.4
8476
```
8577
::: zone-end
86-
### [PowerShell](#tab/PowerShell)
78+
### [Azure PowerShell](#tab/azure-powershell)
8779
8880
::: zone pivot="programming-language-csharp"
8981
```azurepowershell
@@ -126,13 +118,13 @@ Deployment considerations:
126118
127119
Use Azure CLI or Azure PowerShell to validate the deployment.
128120
129-
### [CLI](#tab/CLI)
121+
### [Azure CLI](#tab/azure-cli)
130122
131123
```azurecli-interactive
132124
az resource list --resource-group exampleRG
133125
```
134126

135-
### [PowerShell](#tab/PowerShell)
127+
### [Azure PowerShell](#tab/azure-powershell)
136128

137129
```azurepowershell-interactive
138130
Get-AzResource -ResourceGroupName exampleRG
@@ -144,47 +136,9 @@ Get-AzResource -ResourceGroupName exampleRG
144136

145137
## Clean up resources
146138

147-
Now that you have deployed a function app and related resources to Azure, can continue to the next step of publishing project code to your app. Otherwise, use these commands to delete the resources, when you no longer need them.
148-
149-
### [CLI](#tab/CLI)
150-
151-
```azurecli-interactive
152-
az group delete --name exampleRG
153-
```
154-
155-
### [PowerShell](#tab/PowerShell)
156-
157-
```azurepowershell-interactive
158-
Remove-AzResourceGroup -Name exampleRG
159-
```
160-
161-
---
162-
163-
You can also remove resources by using the [Azure portal](https://portal.azure.com).
139+
[!INCLUDE [functions-cleanup-resources-infra](../../includes/functions-cleanup-resources-infra.md)]
164140

165141
## Next steps
166142

167-
You can now deploy a code project to the function app resources you created in Azure.
168-
169-
You can create, verify, and deploy a code project to your new function app from these local environments:
170-
171-
### [Command prompt](#tab/core-tools)
172-
173-
1. [Create the local code project](./functions-run-local.md#create-your-local-project)
174-
1. [Verify locally](./functions-run-local.md#run-a-local-function)
175-
1. [Publish to Azure](./functions-run-local.md#publish)
176-
177-
### [Visual Studio Code](#tab/vs-code)
178-
179-
1. [Create the local code project](./functions-develop-vs-code.md#create-an-azure-functions-project)
180-
1. [Verify locally](./functions-develop-vs-code.md#run-functions-locally)
181-
1. [Publish to Azure](./functions-develop-vs-code.md#republish-project-files)
182-
183-
### [Visual Studio](#tab/vs)
184-
185-
1. [Create the local code project](./functions-develop-vs.md#create-an-azure-functions-project)
186-
1. [Verify locally](./functions-develop-vs.md#run-functions-locally)
187-
1. [Publish to Azure](./functions-develop-vs.md#publish-to-azure)
188-
189-
---
143+
[!INCLUDE [functions-quickstarts-infra-next-steps](../../includes/functions-quickstarts-infra-next-steps.md)]
190144

Lines changed: 115 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
---
2-
title: Create your first function using Azure Resource Manager templates
2+
title: Create your function app resources using Azure Resource Manager templates
33
description: Create and deploy to Azure a simple HTTP triggered serverless function by using an Azure Resource Manager template (ARM template).
4-
ms.date: 07/19/2022
4+
ms.date: 03/17/2025
55
ms.topic: quickstart
66
ms.service: azure-functions
7+
zone_pivot_groups: programming-languages-set-functions
78
ms.custom: subject-armqs, mode-arm, devx-track-arm-template
89
---
910

1011
# Quickstart: Create and deploy Azure Functions resources from an ARM template
1112

12-
In this article, you use Azure Functions with an Azure Resource Manager template (ARM template) to create a function app and related resources in Azure. The function app provides an execution context for your function code executions.
13+
In this article, you use an Azure Resource Manager template (ARM template) to create a function app in a Flex Consumption plan in Azure, along with its required Azure resources. The function app provides a serverless execution context for your function code executions. The app uses Microsoft Entra ID with managed identities to connect to other Azure resources.
1314

1415
Completing this quickstart incurs a small cost of a few USD cents or less in your Azure account.
1516

1617
[!INCLUDE [About Azure Resource Manager](~/reusable-content/ce-skilling/azure/includes/resource-manager-quickstart-introduction.md)]
1718

18-
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template will open in the Azure portal.
19+
If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template opens in the Azure portal.
1920

2021
:::image type="content" source="~/reusable-content/ce-skilling/azure/media/template-deployments/deploy-to-azure-button.svg" alt-text="Button to deploy the Resource Manager template to Azure." border="false" link="https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.web%2Ffunction-app-create-dynamic%2Fazuredeploy.json":::
2122

22-
After you create the function app, you can deploy Azure Functions project code to that app.
23+
After you create the function app, you can deploy your Azure Functions project code to that app. A final code deployment step is outside the scope of this quickstart article.
2324

2425
## Prerequisites
2526

@@ -33,72 +34,145 @@ The template used in this quickstart is from [Azure Quickstart Templates](https:
3334

3435
:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.web/function-app-create-dynamic/azuredeploy.json":::
3536

36-
The following four Azure resources are created by this template:
37+
This template creates these Azure resources needed by a function app that securely connects to Azure services:
3738

38-
+ [**Microsoft.Storage/storageAccounts**](/azure/templates/microsoft.storage/storageaccounts): create an Azure Storage account, which is required by Functions.
39-
+ [**Microsoft.Web/serverfarms**](/azure/templates/microsoft.web/serverfarms): create a serverless Consumption hosting plan for the function app.
40-
+ [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites): create a function app.
41-
+ [**microsoft.insights/components**](/azure/templates/microsoft.insights/components): create an Application Insights instance for monitoring.
39+
[!INCLUDE [functions-azure-resources-list](../../includes/functions-azure-resources-list.md)]
4240

43-
44-
[!INCLUDE [functions-storage-access-note](../../includes/functions-storage-access-note.md)]
41+
[!INCLUDE [functions-deployment-considerations-infra](../../includes/functions-deployment-considerations-infra.md)]
4542

4643
## Deploy the template
4744

48-
The following scripts are designed for and tested in [Azure Cloud Shell](../cloud-shell/overview.md). Choose **Try It** to open a Cloud Shell instance right in your browser.
45+
These scripts are designed for and tested in [Azure Cloud Shell](../cloud-shell/overview.md). Choose **Try It** to open a Cloud Shell instance right in your browser. When prompted, enter the name of a region that [supports the Flex Consumption plan](./flex-consumption-how-to.md#view-currently-supported-regions), such as `eastus` or `northeurope`.
4946

50-
# [Azure CLI](#tab/azure-cli)
51-
```azurecli-interactive
52-
read -p "Enter a resource group name that is used for generating resource names:" resourceGroupName &&
53-
read -p "Enter the location (like 'eastus' or 'northeurope'):" location &&
54-
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-create-dynamic/azuredeploy.json" &&
47+
### [Azure CLI](#tab/azure-cli)
48+
::: zone pivot="programming-language-csharp"
49+
```azurecli-interactive
50+
read -p "Enter a supported Azure region: " location &&
51+
resourceGroupName=exampleRG &&
52+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json" &&
53+
az group create --name $resourceGroupName --location "$location" &&
54+
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri --parameters functionAppRuntime=dotnet-isolated functionAppRuntimeVersion=8.0 &&
55+
echo "Press [ENTER] to continue ..." &&
56+
read
57+
```
58+
::: zone-end
59+
::: zone pivot="programming-language-java"
60+
```azurecli-interactive
61+
read -p "Enter a supported Azure region: " location &&
62+
resourceGroupName=exampleRG &&
63+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json" &&
64+
az group create --name $resourceGroupName --location "$location" &&
65+
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri --parameters functionAppRuntime=java functionAppRuntimeVersion=17 &&
66+
echo "Press [ENTER] to continue ..." &&
67+
read
68+
```
69+
::: zone-end
70+
::: zone pivot="programming-language-javascript,programming-language-typescript"
71+
```azurecli-interactive
72+
read -p "Enter a supported Azure region: " location &&
73+
resourceGroupName=exampleRG &&
74+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json" &&
75+
az group create --name $resourceGroupName --location "$location" &&
76+
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri --parameters functionAppRuntime=node functionAppRuntimeVersion=20 &&
77+
echo "Press [ENTER] to continue ..." &&
78+
read
79+
```
80+
::: zone-end
81+
::: zone pivot="python"
82+
```azurecli-interactive
83+
read -p "Enter a supported Azure region: " location &&
84+
resourceGroupName=exampleRG &&
85+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json" &&
86+
az group create --name $resourceGroupName --location "$location" &&
87+
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri --parameters functionAppRuntime=python functionAppRuntimeVersion=3.11 &&
88+
echo "Press [ENTER] to continue ..." &&
89+
read
90+
```
91+
::: zone-end
92+
::: zone pivot="powershell"
93+
```azurecli-interactive
94+
read -p "Enter a supported Azure region: " location &&
95+
resourceGroupName=exampleRG &&
96+
templateUri="https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json" &&
5597
az group create --name $resourceGroupName --location "$location" &&
56-
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri &&
98+
az deployment group create --resource-group $resourceGroupName --template-uri $templateUri --parameters functionAppRuntime=powerShell functionAppRuntimeVersion=7.4 &&
5799
echo "Press [ENTER] to continue ..." &&
58100
read
59101
```
60-
# [Azure PowerShell](#tab/azure-powershell)
102+
::: zone-end
61103

104+
### [Azure PowerShell](#tab/azure-powershell)
105+
::: zone pivot="programming-language-csharp"
62106
```powershell-interactive
63-
$resourceGroupName = Read-Host -Prompt "Enter a resource group name that is used for generating resource names"
64-
$location = Read-Host -Prompt "Enter the location (like 'eastus' or 'northeurope')"
65-
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-create-dynamic/azuredeploy.json"
107+
$resourceGroupName = "exampleRG"
108+
$location = Read-Host -Prompt "Enter a supported Azure region"
109+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json"
66110
67111
New-AzResourceGroup -Name $resourceGroupName -Location "$location"
68-
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri
112+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -functionAppRuntime "dotnet-isolated" -functionAppRuntimeVersion "8.0"
69113
70114
Read-Host -Prompt "Press [ENTER] to continue ..."
71115
```
72-
---
116+
::: zone-end
117+
::: zone pivot="programming-language-java"
118+
```powershell-interactive
119+
$resourceGroupName = "exampleRG"
120+
$location = Read-Host -Prompt "Enter a supported Azure region"
121+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json"
73122
74-
[!INCLUDE [functions-welcome-page](../../includes/functions-welcome-page.md)]
123+
New-AzResourceGroup -Name $resourceGroupName -Location "$location"
124+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -functionAppRuntime "java" -functionAppRuntimeVersion "17"
75125
76-
## Clean up resources
126+
Read-Host -Prompt "Press [ENTER] to continue ..."
127+
```
128+
::: zone-end
129+
::: zone pivot="programming-language-javascript,programming-language-typescript"
130+
```powershell-interactive
131+
$resourceGroupName = "exampleRG"
132+
$location = Read-Host -Prompt "Enter a supported Azure region"
133+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json"
77134
78-
If you continue to the next step and add an Azure Storage queue output binding, keep all your resources in place as you'll build on what you've already done.
135+
New-AzResourceGroup -Name $resourceGroupName -Location "$location"
136+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -functionAppRuntime "node" -functionAppRuntimeVersion "20"
79137
80-
Otherwise, use the following command to delete the resource group and all its contained resources to avoid incurring further costs.
138+
Read-Host -Prompt "Press [ENTER] to continue ..."
139+
```
140+
::: zone-end
141+
::: zone pivot="programming-language-python"
142+
```powershell-interactive
143+
$resourceGroupName = "exampleRG"
144+
$location = Read-Host -Prompt "Enter a supported Azure region"
145+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json"
81146
82-
# [Azure CLI](#tab/azure-cli)
147+
New-AzResourceGroup -Name $resourceGroupName -Location "$location"
148+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -functionAppRuntime "python" -functionAppRuntimeVersion "3.11"
83149
84-
```azurecli-interactive
85-
az group delete --name <RESOURCE_GROUP_NAME>
150+
Read-Host -Prompt "Press [ENTER] to continue ..."
86151
```
152+
::: zone-end
153+
::: zone pivot="programming-language-powershell"
154+
```powershell-interactive
155+
$resourceGroupName = "exampleRG"
156+
$location = Read-Host -Prompt "Enter a supported Azure region"
157+
$templateUri = "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/quickstarts/microsoft.web/function-app-flex-managed-identities/azuredeploy.json"
87158
88-
# [Azure PowerShell](#tab/azure-powershell)
159+
New-AzResourceGroup -Name $resourceGroupName -Location "$location"
160+
New-AzResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateUri $templateUri -functionAppRuntime "powershell" -functionAppRuntimeVersion "7.4"
89161
90-
```azurepowershell-interactive
91-
Remove-AzResourceGroup -Name <RESOURCE_GROUP_NAME>
162+
Read-Host -Prompt "Press [ENTER] to continue ..."
92163
```
164+
::: zone-end
93165

94166
---
95167

96-
Replace `<RESOURCE_GROUP_NAME>` with the name of your resource group.
168+
When the deployment finishes, you should see a message indicating the deployment succeeded.
97169

98-
## Next steps
170+
[!INCLUDE [functions-welcome-page](../../includes/functions-welcome-page.md)]
171+
172+
## Clean up resources
99173

100-
Now that you've created your function app resources in Azure, you can deploy your code to the existing app by using one of the following tools:
174+
[!INCLUDE [functions-cleanup-resources-infra](../../includes/functions-cleanup-resources-infra.md)]
175+
176+
## Next steps
101177

102-
* [Visual Studio Code](functions-develop-vs-code.md#republish-project-files)
103-
* [Visual Studio](functions-develop-vs.md#publish-to-azure)
104-
* [Azure Functions Core Tools](functions-run-local.md#publish)
178+
[!INCLUDE [functions-quickstarts-infra-next-steps](../../includes/functions-quickstarts-infra-next-steps.md)]
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
author: ggailey777
3+
ms.service: azure-functions
4+
ms.topic: include
5+
ms.date: 03/17/2025
6+
ms.author: glenga
7+
---
8+
9+
+ [**Microsoft.Web/sites**](/azure/templates/microsoft.web/sites): creates your function app.
10+
+ [**Microsoft.Web/serverfarms**](/azure/templates/microsoft.web/serverfarms): creates a serverless Flex Consumption hosting plan for your app.
11+
+ [**Microsoft.Storage/storageAccounts**](/azure/templates/microsoft.storage/storageaccounts): creates an Azure Storage account, which is required by Functions.
12+
+ [**Microsoft.Insights/components**](/azure/templates/microsoft.insights/components): creates an Application Insights instance for monitoring your app.
13+
+ [**Microsoft.OperationalInsights/workspaces**](/azure/templates/microsoft.operationalinsights/workspaces): creates a workspace required by Application Insights.
14+
+ [**Microsoft.ManagedIdentity/userAssignedIdentities**](/azure/templates/microsoft.managedidentity/userassignedidentities): creates a user-assigned managed identity that's used by the app to authenticate with other Azure services using Microsoft Entra.
15+
+ [**Microsoft.Authorization/roleAssignments**](/azure/templates/microsoft.authorization/roleassignments): creates role assignments to the user-assigned managed identity, which provide the app with least-privilege access when connecting to other Azure services.

0 commit comments

Comments
 (0)