Skip to content

Commit fc1ad27

Browse files
Merge pull request #275958 from ggailey777/release-flex
[Functions] Flex deployment updates
2 parents 3f9901a + b63044d commit fc1ad27

File tree

3 files changed

+64
-44
lines changed

3 files changed

+64
-44
lines changed

articles/azure-functions/flex-consumption-how-to.md

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Create and manage function apps in a Flex Consumption plan
33
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."
4-
ms.date: 05/12/2024
4+
ms.date: 05/21/2024
55
ms.topic: how-to
66
ms.custom:
77
- build-2024
@@ -58,7 +58,7 @@ Function app resources are langauge-specific. Make sure to choose your preferred
5858

5959
## Create a Flex Consumption app
6060

61-
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).
61+
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-Samples/azure-functions-flex-consumption-samples/blob/main/README.md#iac-samples-overview).
6262
::: zone pivot="programming-language-java"
6363
You can skip this section if you choose to instead [create and deploy your app using Maven](#create-and-deploy-your-app-using-maven).
6464
::: zone-end
@@ -171,7 +171,6 @@ You can choose to deploy your project code to an existing function app using var
171171
172172
### [Visual Studio Code](#tab/vs-code-publish)
173173
174-
175174
[!INCLUDE [functions-deploy-project-vs-code](../../includes/functions-deploy-project-vs-code.md)]
176175
177176
### [Core Tools](#tab/core-tools)
@@ -271,8 +270,8 @@ You can't currently enable virtual networking when you use Visual Studio Code to
271270
272271
For end-to-end examples of how to create apps in Flex Consumption with virtual network integration see these resources:
273272
274-
+ [Flex Consumption: HTTP to Event Hubs using VNET Integration](https://github.com/Azure/azure-functions-flex-consumption/blob/main/samples/E2E/HTTP-VNET-EH/README.md)
275-
+ [Flex Consumption: triggered from Service Bus using VNET Integration](https://github.com/Azure/azure-functions-flex-consumption/blob/main/samples/E2E/SB-VNET/README.md)
273+
+ [Flex Consumption: HTTP to Event Hubs using VNET Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/E2E/HTTP-VNET-EH/README.md)
274+
+ [Flex Consumption: triggered from Service Bus using VNET Integration](https://github.com/Azure-Samples/azure-functions-flex-consumption-samples/blob/main/E2E/SB-VNET/README.md)
276275
277276
To modify or delete virtual network integration in an existing app:
278277
@@ -320,33 +319,39 @@ When choosing a subnet, these considerations apply:
320319
+ You can share the same subnet with more than one app running in a Flex Consumption plan. Because the networking resources are shared across all apps, one function app might impact the performance of others on the same subnet.
321320
+ In a Flex Consumption plan, a single function app might use up to 40 IP addresses, even when the app scales beyond 40 instances. While this rule of thumb is helpful when estimating the subnet size you need, it's not strictly enforced.
322321

323-
## Configure the deployment storage account
322+
## Configure deployment settings
324323

325-
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.
324+
In the Flex Consumption plan, the deployment package that contains your app's code is maintained in an Azure Blob Storage container. By default, deployments use the same storage account (`AzureWebJobsStorage`) and connection string value used by the Functions runtime to maintain your app. The connection string is stored in the `DEPLOYMENT_STORAGE_CONNECTION_STRING` application setting. However, you can instead designate a blob container in a separate storage account as the deployment source for your code. You can also change the authentication method used to access the container.
326325

327-
A custom deployment storage account must meet these conditions:
326+
A customized deployment source should meet this criteria:
328327

329328
+ The storage account must already exist.
330-
+ The container to use for deployments must also exist and be empty.
331-
+ An application setting that contains the connection string for the deployment storage account must already exist.
329+
+ The container to use for deployments must also exist.
330+
+ When more than one app uses the same storage account, each should have its own deployment container. Using a unique container for each app prevents the deployment packages from being overwritten, which would happen if apps shared the same container.
331+
332+
When configuring deployment storage authentication, keep these considerations in mind:
333+
334+
+ When you use a connection string to connect to the deployment storage account, the application setting that contains the connection string must already exist.
335+
+ When you use a user-assigned managed identity, the provided identity gets linked to the function app. The `Storage Blob Data Contributor` role scoped to the deployment storage account also gets assigned to the identity.
336+
+ When you use a system-assigned managed identity, an identity gets created when a valid system-assigned identity doesn't already exist in your app. When a system-assigned identity does exists, the `Storage Blob Data Contributor` role scoped to the deployment storage account also gets assigned to the identity.
332337

333-
To configure the deployment storage account when you create your function app in the Flex Consumption plan:
338+
To configure deployment settings when you create your function app in the Flex Consumption plan:
334339

335340
### [Azure CLI](#tab/azure-cli)
336341

337342
Use the [`az functionapp create`] command and supply these additional options that customize deployment storage:
338343

339344
| Parameter | Description |
340345
|--|--|--|
341-
| `--deployment-storage-name` | The storage account name to use for your deployment package. |
342-
| `--deployment-storage-container-name` | The name of the container in the account that contains the deployment package. |
343-
| `--deployment-storage-auth-type`| The authentication type to use for connecting to the deployment storage account. Currently, only `storageAccountConnectionString` is supported. |
344-
| `--deployment-storage-auth-value` | When using `storageAccountConnectionString`, this parameter is set to the name of the application setting that contains the storage account connection string used for deployment. |
346+
| `--deployment-storage-name` | The name of the deployment storage account. |
347+
| `--deployment-storage-container-name` | The name of the container in the account to contain your app's deployment package. |
348+
| `--deployment-storage-auth-type`| The authentication type to use for connecting to the deployment storage account. Accepted values include `StorageAccountConnectionString`, `UserAssignedIdentity`, and `SystemAssignedIdentity`. |
349+
| `--deployment-storage-auth-value` | When using `StorageAccountConnectionString`, this parameter is set to the name of the application setting that contains the connection string to the deployment storage account. When using `UserAssignedIdentity`, this parameter is set to the name of the resource ID of the identity you want to use. |
345350

346-
This example creates a function app in the Flex Consumption plan with a separate deployment storage account:
351+
This example creates a function app in the Flex Consumption plan with a separate deployment storage account and user assigned identity:
347352

348353
```azurecli
349-
az functionapp create --resource-grpoup <RESOURCE_GROUP> --name <APP_NAME> --storage <STORAGE_NAME> --runtime dotnet-isolated --runtime-version 8.0 --flexconsumption-location "<REGION>" --deployment-storage-name <DEPLOYMENT_ACCCOUNT_NAME> --deployment-storage-container-name <DEPLOYMENT_CONTAINER_NAME> --deployment-storage-auth-type storageAccountConnectionString --deployment-storage-auth-value <DEPLOYMENT_CONNECTION_STRING_NAME>"
354+
az functionapp create --resource-group <RESOURCE_GROUP> --name <APP_NAME> --storage <STORAGE_NAME> --runtime dotnet-isolated --runtime-version 8.0 --flexconsumption-location "<REGION>" --deployment-storage-name <DEPLOYMENT_ACCCOUNT_NAME> --deployment-storage-container-name <DEPLOYMENT_CONTAINER_NAME> --deployment-storage-auth-type UserAssignedIdentity --deployment-storage-auth-value <MI_RESOURCE_ID>
350355
```
351356

352357
### [Azure portal](#tab/azure-portal)
@@ -368,16 +373,20 @@ You can also modify the deployment storage configuration for an existing app.
368373
Use the [`az functionapp deployment config set`](/cli/azure/functionapp/deployment/config#az-functionapp-deployment-config-set) command to modify the deployment storage configuration:
369374

370375
```azurecli
371-
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>
376+
az functionapp deployment config set --resource-group <RESOURCE_GROUP> --name <APP_NAME> --deployment-storage-name <DEPLOYMENT_ACCCOUNT_NAME> --deployment-storage-container-name <DEPLOYMENT_CONTAINER_NAME>
372377
```
373378

374379
### [Azure portal](#tab/azure-portal)
375380

376381
1. In your function app page in the [Azure portal](https://portal.azure.com), expand **Settings** in the left menu and select **Deployment settings**.
377382

378-
1. Select an existing **Storage account** and then select an existing empty container in the account.
383+
1. Under Application package location, select an existing **Storage account** and then select an existing empty **container** in the account.
384+
385+
1. Under Storage authentication, select your preferred authentication type
386+
387+
+ If you selected **Connection string**, select the name of the app setting that contains the connection string for the deployment storage account.
379388

380-
1. Select the **App setting name** for the setting that contains the connection string for the deployment storage account.
389+
+ If you selected **User assigned identity**, select the identity you would like to use.
381390

382391
1. Select **Save** to update the app.
383392

@@ -437,7 +446,7 @@ You can't currently change the instance memory size setting for your app using V
437446

438447
## Set always ready instance counts
439448

440-
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.
449+
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. For individual functions, use the format `function:<FUNCTION_NAME>=n`.
441450

442451
### [Azure CLI](#tab/azure-cli)
443452

@@ -450,7 +459,7 @@ az functionapp create --resource-group <RESOURCE_GROUP> --name <APP_NAME> --stor
450459
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`:
451460

452461
```azurecli
453-
az functionapp create --resource-group <RESOURCE_GROUP> --name <APP_NAME> --storage <STORAGE_NAME> --runtime <LANGUAGE_RUNTIME> --runtime-version <RUNTIME_VERSION> --flexconsumption-location <REGION> --always-ready-instances durable=3 function5=2
462+
az functionapp create --resource-group <RESOURCE_GROUP> --name <APP_NAME> --storage <STORAGE_NAME> --runtime <LANGUAGE_RUNTIME> --runtime-version <RUNTIME_VERSION> --flexconsumption-location <REGION> --always-ready-instances durable=3 function:function5=2
454463
```
455464

456465
### [Azure portal](#tab/azure-portal)

articles/azure-functions/flex-consumption-plan.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ Concurrency refers to the number of parallel executions of a function on an inst
8080

8181
Concurrency has a direct effect on how your app scales because at lower concurrency levels, you need more instances to handle the event-driven demand for a function. While you can control and fine tune the concurrency, we provide defaults that work for most cases. To learn how to set concurrency limits for HTTP trigger functions, see [Set HTTP concurrency limits](flex-consumption-how-to.md#set-http-concurrency-limits).
8282

83-
## Deployment storage account
83+
## Deployment
8484

85-
Unlike other plans, project code is deployed to apps in a Flex Consumption plan from a container in a Blob storage account. By default, the same storage account used to store internal host metadata (AzureWebJobsStorage) is also used as the deployment container. However, you can define a second storage account in which to maintain the deployment container. For more information, see [Configure the deployment storage account](flex-consumption-how-to.md#configure-the-deployment-storage-account).
85+
Deployments in the Flex Consumption plan follow a single path. After your project code is built and zipped into an application package, it is deployed to a blob storage container. Upon startup, your app will retrieve the package and run from it. By default, the same storage account used to store internal host metadata (AzureWebJobsStorage) is also used as the deployment container. However, you can use an alternative storage account or choose your preferred authentication method by [configuring your app's deployment settings](flex-consumption-how-to.md#configure-deployment-settings). In streamlining the deployment path, there is no longer the need for app settings to influence deployment behaviour.
8686

8787
## Billing
8888

articles/azure-functions/functions-app-settings.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ Indicates whether all outbound traffic from the app is routed through the virtua
774774

775775
## WEBSITES_ENABLE_APP_SERVICE_STORAGE
776776

777-
Indicates whether the `/home` directory is shared across scaled instances, with a default value of `true`. You should set this to `false` when deploying your function app in a container. d
777+
Indicates whether the `/home` directory is shared across scaled instances, with a default value of `true`. You should set this to `false` when deploying your function app in a container.
778778

779779
## App Service site settings
780780

@@ -821,7 +821,7 @@ Sets the specific version of PowerShell on which your functions run. For more in
821821

822822
When running locally, you instead use the [`FUNCTIONS_WORKER_RUNTIME_VERSION`](functions-reference-powershell.md#running-local-on-a-specific-version) setting in the local.settings.json file.
823823

824-
### vnetrouteallenabled
824+
### vnetRouteAllEnabled
825825

826826
Indicates whether all outbound traffic from the app is routed through the virtual network. A setting value of `1` indicates that all traffic is routed through the virtual network. You need this setting when using features of [Regional virtual network integration](functions-networking-options.md#regional-virtual-network-integration). It's also used when a [virtual network NAT gateway is used to define a static outbound IP address](functions-how-to-use-nat-gateway.md). For more information, see [Configure application routing](../app-service/configure-vnet-integration-routing.md#configure-application-routing).
827827

@@ -831,30 +831,41 @@ This site setting replaces the legacy [WEBSITE\_VNET\_ROUTE\_ALL](#website_vnet_
831831

832832
In the [Flex Consumption plan](./flex-consumption-plan.md), these site properties and application settings are deprecated and shouldn't be used when creating function app resources:
833833

834-
| Property/setting | Reason |
834+
| Setting/property | Reason |
835835
| ----- | ----- |
836-
| `properties.ftpsState` | FTPS not supported |
837-
| `properties.use32BitWorkerProcess` |32-bit not supported |
838-
| `properties.isReserved` |Not valid|
839-
| `properties.IsXenon` |Not valid|
840-
| `properties.windowsFxVersion` |Not valid|
841-
| `properties.alwaysOn` |Not valid|
842-
| `properties.siteConfig.preWarmedInstanceCount` | Renamed as `alwaysReadyInstances` |
843-
| `properties.siteConfig.functionAppScaleLimit` |Renamed as `maximumInstanceCount`|
844-
| `properties.containerSize` |Renamed as `instanceMemoryMB`|
845-
| `properties.javaVersion` | Replaced by `version` in `properties.functionAppConfig.runtime`|
846-
| `properties.powerShellVersion` |Replaced by `version` in `properties.functionAppConfig.runtime`|
847-
| `properties.netFrameworkVersion` |Replaced by `version` in `properties.functionAppConfig.runtime`|
848-
| `properties.LinuxFxVersion` |Replaced by `properties.functionAppConfig.runtime`|
849-
| `WEBSITE_NODE_DEFAULT_VERSION` |Replaced by `version` in `properties.functionAppConfig.runtime`|
836+
| `ENABLE_ORYX_BUILD` |Replaced by the `remoteBuild` parameter when deploying in Flex Consumption|
850837
| `FUNCTIONS_EXTENSION_VERSION` |App Setting is set by the backend. A value of ~1 can be ignored. |
851838
| `FUNCTIONS_WORKER_RUNTIME` |Replaced by `name` in `properties.functionAppConfig.runtime`|
852839
| `FUNCTIONS_WORKER_RUNTIME_VERSION` |Replaced by `version` in `properties.functionAppConfig.runtime`|
853-
| `FUNCTIONS_MAX_HTTP_CONCURRENCY` |App Setting replaced by scale and concurrency's trigger section|
840+
| `FUNCTIONS_MAX_HTTP_CONCURRENCY` |Replaced by scale and concurrency's trigger section|
854841
| `FUNCTIONS_WORKER_PROCESS_COUNT` |Setting not valid|
855842
| `FUNCTIONS_WORKER_DYNAMIC_CONCURRENCY_ENABLED` |Setting not valid|
856-
| `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` |App Setting replaced by functionAppConfig's deployment section|
857-
| `WEBSITE_CONTENTSHARE` |App Setting replaced by functionAppConfig's deployment section|
843+
| `SCM_DO_BUILD_DURING_DEPLOYMENT`|Replaced by the `remoteBuild` parameter when deploying in Flex Consumption|
844+
| `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING` |Replaced by functionAppConfig's deployment section|
845+
| `WEBSITE_CONTENTOVERVNET` |Not used for networking in Flex Consumption|
846+
| `WEBSITE_CONTENTSHARE` |Replaced by functionAppConfig's deployment section|
847+
| `WEBSITE_DNS_SERVER` |DNS is inherited from the integrated VNet in Flex|
848+
| `WEBSITE_NODE_DEFAULT_VERSION` |Replaced by `version` in `properties.functionAppConfig.runtime`|
849+
| `WEBSITE_RUN_FROM_PACKAGE`|Not used for deployments in Flex Consumption|
850+
| `WEBSITE_SKIP_CONTENTSHARE_VALIDATION` |Content share is not used in Flex Consumption|
851+
| `WEBSITE_VNET_ROUTE_ALL` |Not used for networking in Flex Consumption|
852+
| `properties.alwaysOn` |Not valid|
853+
| `properties.containerSize` |Renamed as `instanceMemoryMB`|
854+
| `properties.ftpsState` | FTPS not supported |
855+
| `properties.isReserved` |Not valid|
856+
| `properties.IsXenon` |Not valid|
857+
| `properties.javaVersion` | Replaced by `version` in `properties.functionAppConfig.runtime`|
858+
| `properties.LinuxFxVersion` |Replaced by `properties.functionAppConfig.runtime`|
859+
| `properties.netFrameworkVersion` |Replaced by `version` in `properties.functionAppConfig.runtime`|
860+
| `properties.powerShellVersion` |Replaced by `version` in `properties.functionAppConfig.runtime`|
861+
| `properties.siteConfig.functionAppScaleLimit` |Renamed as `maximumInstanceCount`|
862+
| `properties.siteConfig.preWarmedInstanceCount` | Renamed as `alwaysReadyInstances` |
863+
| `properties.use32BitWorkerProcess` |32-bit not supported |
864+
| `properties.vnetBackupRestoreEnabled` |Not used for networking in Flex Consumption|
865+
| `properties.vnetContentShareEnabled` |Not used for networking in Flex Consumption|
866+
| `properties.vnetImagePullEnabled` |Not used for networking in Flex Consumptionlid|
867+
| `properties.vnetRouteAllEnabled` |Not used for networking in Flex Consumption|
868+
| `properties.windowsFxVersion` |Not valid|
858869

859870
## Next steps
860871

0 commit comments

Comments
 (0)