Skip to content

Commit 0148d0a

Browse files
author
Jill Grant
authored
Merge pull request #277155 from im-samz/batch-networking-fixes
Batch Functions Networking fixes
2 parents ded5f9f + d15c2af commit 0148d0a

File tree

6 files changed

+68
-27
lines changed

6 files changed

+68
-27
lines changed

articles/azure-functions/configure-networking-how-to.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: How to use a secured storage account with Azure Functions
33
description: Article that shows you how to use a secured storage account in a virtual network as the default storage account for a function app in Azure Functions.
44
ms.topic: how-to
5-
ms.date: 05/06/2024
5+
ms.date: 06/03/2024
66
ms.custom: template-how-to, build-2024
77
---
88

@@ -12,23 +12,26 @@ This article shows you how to connect your function app to a secured storage acc
1212

1313
## Restrict your storage account to a virtual network
1414

15-
When you create a function app, you either create a new storage account or link to an existing one. Currently, only [ARM template and Bicep deployments](functions-infrastructure-as-code.md#secured-deployments) support function app creation with an existing secured storage account.
15+
When you create a function app, you either create a new storage account or link to an existing one. Currently, only the Azure portal, [ARM template deployments](functions-infrastructure-as-code.md?tabs=json&pivots=premium-plan#secured-deployments), and [Bicep deployments](functions-infrastructure-as-code.md?tabs=bicep&pivots=premium-plan#secured-deployments) support function app creation with an existing secured storage account.
1616

1717
> [!NOTE]
1818
> Securing your storage account is supported for all tiers of the [Dedicated (App Service) plan](./dedicated-plan.md) and the [Elastic Premium plan](./functions-premium-plan.md), as well as in the [Flex Consumption plan](./flex-consumption-plan.md).
19-
> Consumption plans don't support virtual networks.
19+
> The [Consumption plan](consumption-plan.md) doesn't support virtual networks.
2020
2121
For a list of all restrictions on storage accounts, see [Storage account requirements](storage-considerations.md#storage-account-requirements).
2222

2323
[!INCLUDE [functions-flex-preview-note](../../includes/functions-flex-preview-note.md)]
2424

2525
## Secure storage during function app creation
2626

27-
You can create a function app along with a new storage account secured behind a virtual network that is accessible via private endpoints. The following links show you how to create these resources by using either the Azure portal or by using deployment templates:
27+
You can create a function app along with a new storage account that is secured behind a virtual network. The following links show you how to create these resources by using either the Azure portal or by using deployment templates:
2828

2929
### [Azure portal](#tab/portal)
3030

31-
Complete the following tutorial to create a new function app a secured storage account: [Use private endpoints to integrate Azure Functions with a virtual network](functions-create-vnet.md).
31+
Complete the steps in [Create a function app in a Premium plan](functions-create-vnet.md#create-a-function-app-in-a-premium-plan). This section of the virtual networking tutorial shows you how to create a function app that connects to storage over private endpoints.
32+
33+
> [!NOTE]
34+
> When you create your function app in the Azure portal, you can also choose an existing secured storage account in the **Storage** tab. However, you must configure the appropriate networking on the function app so that it can connect through the virtual network used to secure the storage account. If you don't have permissions to configure networking or you haven't fully prepared your network, select **Configure networking after creation** in the **Networking** tab. You can configure networking for your new function app in the portal under **Settings** > **Networking**.
3235
3336
### [Deployment templates](#tab/templates)
3437

@@ -38,7 +41,9 @@ Use Bicep files or Azure Resource Manager (ARM) templates to create a secured fu
3841

3942
## Secure storage for an existing function app
4043

41-
When you have an existing function app, you can't directly secure the storage account currently being used by the app. You must instead swap-out the existing storage account for a new, secured storage account.
44+
When you have an existing function app, you can directly configure networking on the storage account being used by the app. This process results in your app being down while you configure networking and while your app restarts.
45+
46+
To minimize downtime, you can instead swap-out an existing storage account for a new, secured storage account.
4247

4348
### 1. Enable virtual network integration
4449

@@ -70,6 +75,10 @@ Now you're ready to configure your function app to communicate with the newly se
7075

7176
### 3. Enable application and configuration routing
7277

78+
> [!NOTE]
79+
> These configuration steps are only required for the [Elastic Premium](./functions-premium-plan.md) and [Dedicated (App Service)](./dedicated-plan.md) hosting plans.
80+
> The [Flex Consumption plan](./flex-consumption-plan.md) doesn't require site settings to configure networking.
81+
7382
You should now route your function app's traffic to go through the virtual network.
7483

7584
1. Enable [application routing](../app-service/overview-vnet-integration.md#application-routing) to route your app's traffic into the virtual network.

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,16 @@ Azure Files doesn't support using managed identity when accessing the file share
621621

622622
## WEBSITE\_CONTENTOVERVNET
623623

624-
A value of `1` enables your function app to scale when you have your storage account restricted to a virtual network. You should enable this setting when restricting your storage account to a virtual network. Only required when using `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`. To learn more, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
624+
> [!IMPORTANT]
625+
> WEBSITE_CONTENTOVERVNET is a legacy app setting that has been replaced by the [vnetContentShareEnabled](#vnetcontentshareenabled) site property.
626+
627+
A value of `1` enables your function app to scale when you have your storage account restricted to a virtual network. You should enable this setting when restricting your storage account to a virtual network. Only required when using `WEBSITE_CONTENTSHARE` and `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`. To learn more, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
625628

626629
|Key|Sample value|
627630
|---|------------|
628631
|WEBSITE_CONTENTOVERVNET|`1`|
629632

630-
Supported on [Premium](functions-premium-plan.md) and [Dedicated (App Service) plans](dedicated-plan.md) (Standard and higher). Not supported when running on a [Consumption plan](consumption-plan.md).
633+
This app setting is required on the [Elastic Premium](functions-premium-plan.md) and [Dedicated (App Service) plans](dedicated-plan.md) (Standard and higher). Not supported when running on a [Consumption plan](consumption-plan.md).
631634

632635
## WEBSITE\_CONTENTSHARE
633636

@@ -772,7 +775,7 @@ Indicates whether to use a specific [cold start](event-driven-scaling.md#cold-st
772775
> [!IMPORTANT]
773776
> WEBSITE_VNET_ROUTE_ALL is a legacy app setting that has been replaced by the [vnetRouteAllEnabled](#vnetrouteallenabled) site setting.
774777
775-
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).
778+
Indicates whether all outbound traffic from the app is routed through the virtual network. A setting value of `1` indicates that all application traffic is routed through the virtual network. You'll need this setting when configuring [Regional virtual network integration](functions-networking-options.md#regional-virtual-network-integration) in the Elastic Premium and Dedicated hosting plans. 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).
776779

777780
|Key|Sample value|
778781
|---|------------|
@@ -827,9 +830,19 @@ Sets the specific version of PowerShell on which your functions run. For more in
827830

828831
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.
829832

833+
### vnetContentShareEnabled
834+
835+
Apps running in a Premium plan use a file share to store content. The name of this content share is stored in the [`WEBSITE_CONTENTSHARE`](#website_contentshare) app setting and its connection string is stored in [`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`](#website_contentazurefileconnectionstring). To route traffic between your function app and content share through a virtual network, you must also set `vnetContentShareEnabled` to `true`. Enabling this site property is a requirement when [restricting your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network) in the Elastic Premium and Dedicated hosting plans.
836+
837+
This site property replaces the legacy [`WEBSITE_CONTENTOVERVNET`](#website_contentovervnet) setting.
838+
839+
### vnetImagePullEnabled
840+
841+
Functions [supports function apps running in Linux containers](functions-how-to-custom-container.md). To connect and pull from a container registry inside a virtual network, you must set `vnetImagePullEnabled` to `true`. This site property is supported in the Elastic Premium and Dedicated hosting plans. The Flex Consumption plan doesn't rely on site properties or app settings to configure Networking. For more information, see [Flex Consumption plan deprecations](#flex-consumption-plan-deprecations).
842+
830843
### vnetRouteAllEnabled
831844

832-
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).
845+
Indicates whether all outbound traffic from the app is routed through the virtual network. A setting value of `true` indicates that all application traffic is routed through the virtual network. Use this setting when configuring [Regional virtual network integration](functions-networking-options.md#regional-virtual-network-integration) in the Elastic Premium and Dedicated plans. 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).
833846

834847
This site setting replaces the legacy [WEBSITE\_VNET\_ROUTE\_ALL](#website_vnet_route_all) setting.
835848

articles/azure-functions/functions-networking-options.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,18 @@ When testing functions in a function app with private endpoints, you must do you
304304
* `https://functions.azure.com`
305305
* `https://portal.azure.com`
306306

307+
If you've restricted access to your function app with private endpoints or any other access restriction, you also must add the service tag `AzureCloud` to the allow-list. To update the allow-list:
308+
309+
1. Navigate to your function app and select **Settings** > **Networking** and then select **Inbound access configuration** > **Public network access**.
310+
311+
1. Make sure that **Public network access** is set to **Enabled from select virtual networks and IP addresses**.
312+
313+
1. **Add a rule** under Site access and rules:
314+
315+
1. Select `Service Tag` as the Source settings **Type** and `AzureCloud` as the **Service Tag**.
316+
317+
1. Make sure the action is **Allow**, and set your desired name and priority.
318+
307319
## Troubleshooting
308320

309321
[!INCLUDE [app-service-web-vnet-troubleshooting](../../includes/app-service-web-vnet-troubleshooting.md)]

articles/azure-functions/run-functions-from-deployment-package.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ This section provides information about how to run your function app from a pack
8585

8686
<a name="troubleshooting"></a>
8787

88-
+ When running a function app on Windows, the app setting `WEBSITE_RUN_FROM_PACKAGE = <URL>` gives worse cold-start performance and isn't recommended.
88+
+ Function apps running on Windows experience a slight increase in [cold start time](event-driven-scaling.md#cold-start) when the application package is deployed to a URL endpoint via `WEBSITE_RUN_FROM_PACKAGE = <URL>`.
8989
+ When you specify a URL, you must also [manually sync triggers](functions-deployment-technologies.md#trigger-syncing) after you publish an updated package.
9090
+ The Functions runtime must have permissions to access the package URL.
9191
+ You shouldn't deploy your package to Azure Blob Storage as a public blob. Instead, use a private container with a [Shared Access Signature (SAS)](../storage/common/storage-sas-overview.md) or [use a managed identity](#fetch-a-package-from-azure-blob-storage-using-a-managed-identity) to enable the Functions runtime to access the package.

0 commit comments

Comments
 (0)