You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Create and manage function apps in a Flex Consumption plan
3
3
description: "Learn how to create function apps hosted in the Flex Consumption plan in Azure Functions and how to modify specific settings for an existing function app."
@@ -27,8 +27,7 @@ Function app resources are langauge-specific. Make sure to choose your preferred
27
27
+ While not required to create a Flex Consumption plan app, you need a code project to be able to deploy to and validate a new function app. Complete the first part of one of these quickstart articles, where you creat a code project with an HTTP triggered function:
28
28
29
29
::: zone pivot="programming-language-csharp"
30
-
+[Create an Azure Functions project from the command line](create-first-function-cli-csharp.md)
31
-
+[Create an Azure Functions project using Visual Studio](./functions-create-your-first-function-visual-studio.md)
30
+
+[Create an Azure Functions project from the command line](create-first-function-cli-csharp.md)
32
31
+[Create an Azure Functions project using Visual Studio Code](create-first-function-vs-code-csharp.md)
33
32
::: zone-end
34
33
::: zone pivot="programming-language-javascript"
@@ -56,18 +55,6 @@ Function app resources are langauge-specific. Make sure to choose your preferred
56
55
57
56
Return to this article after you create and run the local project, but before you're asked to create Azure resources. You create the function app and other Azure resources in the next section.
58
57
59
-
## View currently supported regions
60
-
61
-
During the preview, you're only able to run on the Flex Consumption plan in selected regions. Use this Azure CLI command to review the list of regions that currently support Flex Consumption.
62
-
63
-
```azurecli-interactive
64
-
az functionapp list-flexconsumption-locations --output table
65
-
```
66
-
67
-
You need to first run `az login` when you aren't already signed-in to your Azure account.
68
-
69
-
When you create an app in the Azure portal, currently unsupported regions are filtered out of the region list.
70
-
71
58
## Create a Flex Consumption app
72
59
73
60
This section shows you how to create a function app in the Flex Consumption plan by using either the Azure CLI, Azure portal, or Visual Studio Code. For an example of creating an app in a Flex Consumption plan using Bicep/ARM templates, see the [Flex Consumption repository](https://github.com/Azure/azure-functions-flex-consumption/blob/main/samples/README.md#iac-samples-overview).
@@ -83,23 +70,17 @@ To support your function code, you need to create three resources:
83
70
84
71
### [Azure CLI](#tab/azure-cli)
85
72
86
-
1. If you haven't done so already, sign in to Azure:
87
-
88
-
```azurecli
89
-
az login
90
-
```
91
-
92
-
The [`az login`](/cli/azure/reference-index#az-login) command signs you into your Azure account.
1. Create a resource group in one of the [currently supported regions](#view-currently-supported-regions):
75
+
3. Create a resource group in one of the [currently supported regions](#view-currently-supported-regions):
95
76
96
77
```azurecli
97
78
az group create --name <RESOURCE_GROUP> --location <REGION>
98
79
```
99
80
100
81
In the above command, replace `<RESOURCE_GROUP>` with a value that's unique in your subscription and `<REGION>` with one of the [currently supported regions](#view-currently-supported-regions). The [az group create](/cli/azure/group#az-group-create) command creates a resource group.
101
82
102
-
1. Create a general-purpose storage account in your resource group and region:
83
+
4. Create a general-purpose storage account in your resource group and region:
In this example, replace both `<RESOURCE_GROUP>` and `<STORAGE_NAME>` with the resource group and the name of the account you used in the previous step, respectively. Also replace `<APP_NAME>` with a globally unique name appropriate to you. The `<APP_NAME>` is also the default DNS domain for the function app. The [`az functionapp create`] command creates the function app in Azure.
125
+
In this example, replace both `<RESOURCE_GROUP>` and `<STORAGE_NAME>` with the resource group and the name of the account you used in the previous step, respectively. Also replace `<APP_NAME>` with a globally unique name appropriate to you. The `<APP_NAME>` is also the default domain name server (DNS) domain for the function app. The [`az functionapp create`] command creates the function app in Azure.
145
126
146
127
This command creates a function app running in the Flex Consumption plan. The specific language runtime version used is one that is currently supported in the preview.
147
128
@@ -154,7 +135,6 @@ To support your function code, you need to create three resources:
154
135
155
136
### [Visual Studio Code](#tab/vs-code)
156
137
157
-
158
138
1. Press F1, and in the command pallet enter **Azure Functions: Create function app in Azure...(Advanced)**.
159
139
160
140
1. If you're not signed in, you're prompted to **Sign in to Azure**. You can also **Create a free Azure account**. After signing in from the browser, go back to Visual Studio Code.
@@ -202,7 +182,6 @@ You can use Maven to create a Flex Consumption hosted function app and required
202
182
203
183
+ [Create an Azure Functions project from the command line](create-first-function-cli-java.md)
204
184
+ [Create an Azure Functions project using Visual Studio Code](create-first-function-vs-code-java.md)
205
-
::: zone-end
206
185
207
186
1. In your Java code project, open the pom.xml file and make these changes to create your function app in the Flex Consumption plan:
208
187
@@ -241,7 +220,17 @@ You can use Maven to create a Flex Consumption hosted function app and required
241
220
242
221
In the Flex Consumption plan, the deployment package that contains your app's code is maintained in a blob storage container. By default, deployments use the same storage account and connection string (`AzureWebJobsStorage`) used by the Functions runtime to maintain your app. However, you can instead designate a blob container in a separate storage account as the deployment source for your code.
243
222
244
-
You can configure the deployment storage account when using the Azure CLI by setting these optional parameters when you use the [`az functionapp create`] command:
223
+
A custom deployment storage account must meet these conditions:
224
+
225
+
+ The storage account must already exist.
226
+
+ The container to use for deployments must also exist and be empty.
227
+
+ An application setting that contains the connection string for the deployment storage account must already exist.
228
+
229
+
To configure the deployment storage account when you create your function app in the Flex Consumption plan:
230
+
231
+
### [Azure CLI](#tab/azure-cli)
232
+
233
+
Use the [`az functionapp create`] command and supply these additional options that customize deployment storage:
245
234
246
235
| Parameter | Description |
247
236
|--|--|--|
@@ -253,15 +242,48 @@ You can configure the deployment storage account when using the Azure CLI by set
253
242
This example creates a function app in the Flex Consumption plan with a separate deployment storage account:
You can also modify the deployment storage configuration used to deploy to an existing app.
249
+
250
+
### [Azure portal](#tab/azure-portal)
251
+
252
+
You can't currently configure deployment storage when creating your app in the Azure portal. To configure deployment storage during app creation, instead use the Azure CLI to create your app.
253
+
254
+
You can use the portal to modify the deployment settings of an existing app, as detailed in the next section.
255
+
256
+
### [Visual Studio Code](#tab/vs-code)
257
+
258
+
You can't currently configure deployment storage when creating your app in Azure using Visual Studio Code.
259
+
260
+
---
261
+
262
+
### [Azure CLI](#tab/azure-cli)
263
+
259
264
You can also use the [`az functionapp deployment config set`](/cli/azure/functionapp/deployment/config#az-functionapp-deployment-config-set) command to modify the deployment storage configuration:
260
265
261
266
```azurecli
262
267
az functionapp deployment config set --resource-grpoup <RESOURCE_GROUP> --name <APP_NAME> --deployment-storage-name <DEPLOYMENT_ACCCOUNT_NAME> --deployment-storage-container-name <DEPLOYMENT_CONTAINER_NAME>
263
268
```
264
269
270
+
### [Azure portal](#tab/azure-portal)
271
+
272
+
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Deployment settings**.
273
+
274
+
1. Select an existing **Storage account** and then select an existing empty container in the account.
275
+
276
+
1. Select the **App setting name** for the setting that contains the connection string for the deployment storage account.
277
+
278
+
1. Select **Save** to update the app.
279
+
280
+
281
+
### [Visual Studio Code](#tab/vs-code)
282
+
283
+
You can't currently configure deployment storage for your app in Azure using Visual Studio Code.
284
+
285
+
---
286
+
265
287
## Configure instance memory
266
288
267
289
The instance memory size used by your Flex Consumption plan can be explicitly set when you create your app. For more information about supported sizes, see [Instance memory](flex-consumption-plan.md#instance-memory).
@@ -286,28 +308,63 @@ You can't currently control the instance memory size when you use Visual Studio
286
308
287
309
---
288
310
289
-
At any point, you can change the instance memory size setting for your app by using the Azure CLI. This example uses the [`az functionapp scale config set`](/cli/azure/functionapp/scale/config#az-functionapp-scale-config-set) command to change the instance memory size setting to 512 MB:
311
+
At any point, you can change the instance memory size setting used by your app.
312
+
313
+
### [Azure CLI](#tab/azure-cli)
314
+
315
+
This example uses the [`az functionapp scale config set`](/cli/azure/functionapp/scale/config#az-functionapp-scale-config-set) command to change the instance memory size setting to 512 MB:
290
316
291
317
```azurecli
292
318
az functionapp scale config set -g <resourceGroup> --name <APP_NAME> --instance-memory 512
293
319
```
294
320
321
+
### [Azure portal](#tab/azure-portal)
322
+
323
+
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
324
+
325
+
1. Select an **Instance memory** option and select **Save** to update the app.
326
+
327
+
328
+
### [Visual Studio Code](#tab/vs-code)
329
+
330
+
You can't currently change the instance memory size setting for your app using Visual Studio Code.
331
+
332
+
---
333
+
295
334
## Set always ready instance counts
296
335
297
-
When creating an app in a Flex Consumption plan, you can set the always ready instance count for specific groups (HTTP or Durable triggers) and triggers by using the `--always-ready-instances` parameter. If you don't want any always ready instances, just leave this optional parameter out of your [`az functionapp create`] command. You can also change always ready instances on an existing app.
336
+
When creating an app in a Flex Consumption plan, you can set the always ready instance count for specific groups (HTTP or Durable triggers) and triggers.
337
+
338
+
### [Azure CLI](#tab/azure-cli)
298
339
299
-
This example sets the always ready instance count for all HTTP triggered functions to `5`:
340
+
Use the `--always-ready-instances` parameter with the [`az functionapp create`] command to define one or more always ready instance designations. This example sets the always ready instance count for all HTTP triggered functions to `5`:
This example sets the always ready instance count for all Durable trigger functions to `3` and sets the always ready instance count to `2` for a service bus triggered function named `function5`:
You can't currently define always ready instances when creating your app in the Azure portal. To define always ready instances during app creation, instead use the Azure CLI to create your app.
355
+
356
+
You can use the portal to modify always ready instances on an existing app, as detailed in the next section.
357
+
358
+
### [Visual Studio Code](#tab/vs-code)
359
+
360
+
You can't currently define always ready instances when creating your app in Azure using Visual Studio Code.
361
+
362
+
---
363
+
364
+
You can also modify always ready instances on an existing app by adding or removing instance designations or by changing existing instance designation counts.
365
+
366
+
### [Azure CLI](#tab/azure-cli)
367
+
311
368
This example uses the [`az functionapp scale config always-ready set`](/cli/azure/functionapp/scale/config/always-ready#az-functionapp-scale-config-always-ready-set) command to change the always ready instance count for the HTTP triggers group to `10`:
312
369
313
370
```azurecli
@@ -320,18 +377,55 @@ To remove always ready instances, use the [`az functionapp scale config always-r
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
383
+
384
+
1. Under **Always-ready instance minimum** type `http`, `blob`, `durable`, or a specific function name in **Trigger** and type the **Number of always-ready instances**.
385
+
386
+
1. Select **Save** to update the app.
387
+
388
+
### [Visual Studio Code](#tab/vs-code)
389
+
390
+
You can't currently modify always ready instances using Visual Studio Code.
391
+
392
+
---
393
+
323
394
## Set HTTP concurrency limits
324
395
325
396
By default, HTTP concurrency defaults for Flex Consumption plan apps are determined based on your instance size setting. For more information, see [HTTP trigger concurrency](functions-concurrency.md#http-trigger-concurrency).
326
397
327
-
You can use the [`az functionapp scale config set`](/cli/azure/functionapp/scale/config#az-functionapp-scale-config-set) command to set specific HTTP concurrency limits for your app, regardless of instance size.
398
+
### [Azure CLI](#tab/azure-cli)
399
+
400
+
Use the [`az functionapp scale config set`](/cli/azure/functionapp/scale/config#az-functionapp-scale-config-set) command to set specific HTTP concurrency limits for your app, regardless of instance size.
328
401
329
402
```azurecli
330
403
az functionapp scale config set -resource-group <RESOURCE_GROUP> -name <APP_NAME> --trigger-type http --trigger-settings perInstanceConcurrency=10
331
404
```
332
405
333
406
This example sets the HTTP trigger concurrency level to `10`. After you specifically set an HTTP concurrency value, that value is maintained despite any changes in your app's instance size setting.
334
407
408
+
### [Azure portal](#tab/azure-portal)
409
+
410
+
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Scale and concurrency**.
411
+
412
+
1. Under **Concurrency per instance** select **Assign manually** and type a specific limit.
413
+
414
+
1. Select **Save** to update the app.
415
+
416
+
### [Visual Studio Code](#tab/vs-code)
417
+
418
+
You can't currently modify always ready instances using Visual Studio Code.
419
+
420
+
---
421
+
422
+
## View currently supported regions
423
+
424
+
During the preview, you're only able to run on the Flex Consumption plan in selected regions. To view the list of regions that currently support Flex Consumption plans:
When you create an app in the [Azure portal](flex-consumption-how-to.md?tabs=azure-portal#create-a-flex-consumption-app) or by using [Visual Studio Code](flex-consumption-how-to.md?tabs=vs-code#create-a-flex-consumption-app), currently unsupported regions are filtered out of the region list.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-app-settings.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -846,7 +846,7 @@ In the [Flex Consumption plan](./flex-consumption-plan.md), these site propertie
846
846
|`properties.netFrameworkVersion`|Replaced by `version` in `properties.functionAppConfig.runtime`|
847
847
|`properties.LinuxFxVersion`|Replaced by `properties.functionAppConfig.runtime`|
848
848
|`WEBSITE_NODE_DEFAULT_VERSION`|Replaced by `version` in `properties.functionAppConfig.runtime`|
849
-
| `FUNCTIONS_EXTENSION_VERSION` |App Setting will be set by the backend to the right value|. You may notice this setting being set to ~1 by the backend, this can be ignored.
849
+
|`FUNCTIONS_EXTENSION_VERSION`|App Setting is set by the backend. A value of ~1 can be ignored.|
850
850
|`FUNCTIONS_WORKER_RUNTIME`|Replaced by `name` in `properties.functionAppConfig.runtime`|
851
851
|`FUNCTIONS_WORKER_RUNTIME_VERSION`|Replaced by `version` in `properties.functionAppConfig.runtime`|
852
852
|`FUNCTIONS_MAX_HTTP_CONCURRENCY`|App Setting replaced by scale and concurrency's trigger section|
0 commit comments