Skip to content

Commit 3e23aa9

Browse files
Merge pull request #278091 from dksimpson/tsk261306-dks-2
Refresh article: How to use a secured storage account with Azure Functions [Task 261306]
2 parents 5f38d68 + 14c012c commit 3e23aa9

File tree

1 file changed

+40
-34
lines changed

1 file changed

+40
-34
lines changed

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

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,116 @@
11
---
22
title: How to use a secured storage account with Azure Functions
3-
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.
3+
description: Learn how to use a secured storage account in a virtual network as the default storage account for a function app in Azure Functions.
4+
ms-service: azure-functions
45
ms.topic: how-to
5-
ms.date: 06/03/2024
6+
ms.date: 06/27/2024
67
ms.custom: template-how-to, build-2024
8+
9+
# Customer intent: As a developer, I want to understand how to use a secured storage account in a virtual network as the default storage account for my function app, so that my function app can be secure.
10+
711
---
812

913
# How to use a secured storage account with Azure Functions
1014

11-
This article shows you how to connect your function app to a secured storage account. For an in-depth tutorial on how to create your function app with inbound and outbound access restrictions, refer to the [Integrate with a virtual network](functions-create-vnet.md) tutorial. To learn more about Azure Functions and networking, see [Azure Functions networking options](functions-networking-options.md).
15+
This article shows you how to connect your function app to a secured storage account. For an in-depth tutorial on how to create your function app with inbound and outbound access restrictions, see the [Integrate with a virtual network](functions-create-vnet.md) tutorial. To learn more about Azure Functions and networking, see [Azure Functions networking options](functions-networking-options.md).
1216

13-
## Restrict your storage account to a virtual network
17+
## Restrict your storage account to a virtual network
1418

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.
19+
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.
1620

1721
> [!NOTE]
18-
> 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).
22+
> Secured storage accounts are supported for all tiers of the [Dedicated (App Service) plan](./dedicated-plan.md) and the [Elastic Premium plan](./functions-premium-plan.md). They're also supported by the [Flex Consumption plan](./flex-consumption-plan.md).
1923
> The [Consumption plan](consumption-plan.md) doesn't support virtual networks.
2024
2125
For a list of all restrictions on storage accounts, see [Storage account requirements](storage-considerations.md#storage-account-requirements).
2226

2327
[!INCLUDE [functions-flex-preview-note](../../includes/functions-flex-preview-note.md)]
2428

25-
## Secure storage during function app creation
29+
## Secure storage during function app creation
2630

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:
31+
You can create a function app, along with a new storage account that is secured behind a virtual network. The following sections show you how to create these resources by using either the Azure portal or by using deployment templates.
2832

2933
### [Azure portal](#tab/portal)
3034

3135
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.
3236

33-
> [!NOTE]
37+
> [!NOTE]
3438
> 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**.
3539
3640
### [Deployment templates](#tab/templates)
3741

38-
Use Bicep files or Azure Resource Manager (ARM) templates to create a secured function app and storage account resources. When you create a secured storage account in an automated deployment, you must set the `vnetContentShareEnabled` site property, create the file share as part of your deployment, and set the `WEBSITE_CONTENTSHARE` app setting to the name of the file share. For more information, including links to example deployments, see [Secured deployments](functions-infrastructure-as-code.md#secured-deployments).
42+
Use Bicep files or Azure Resource Manager (ARM) templates to create a secured function app and storage account resources. When you create a secured storage account in an automated deployment, you must set the `vnetContentShareEnabled` site property, create the file share as part of your deployment, and set the `WEBSITE_CONTENTSHARE` app setting to the name of the file share. For more information, including links to example deployments, see [Secured deployments](functions-infrastructure-as-code.md?pivots=premium-plan#secured-deployments).
3943

4044
---
4145

4246
## Secure storage for an existing function app
4347

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.
48+
When you have an existing function app, you can directly configure networking on the storage account being used by the app. However, this process results in your function app being down while you configure networking and while your function app restarts.
4549

4650
To minimize downtime, you can instead swap-out an existing storage account for a new, secured storage account.
4751

4852
### 1. Enable virtual network integration
4953

50-
As a prerequisite, you need to enable virtual network integration for your function app.
54+
As a prerequisite, you need to enable virtual network integration for your function app:
5155

5256
1. Choose a function app with a storage account that doesn't have service endpoints or private endpoints enabled.
5357

5458
1. [Enable virtual network integration](./functions-networking-options.md#enable-virtual-network-integration) for your function app.
5559

56-
### 2. Create a secured storage account
60+
### 2. Create a secured storage account
5761

58-
Set up a secured storage account for your function app:
62+
Set up a secured storage account for your function app:
5963

60-
1. [Create a second storage account](../storage/common/storage-account-create.md). This is going to be the secured storage account that your function app will use instead. You can also use an existing storage account not already being used by Functions.
64+
1. [Create a second storage account](../storage/common/storage-account-create.md). This storage account is the secured storage account for your function app to use instead of its original unsecured storage account. You can also use an existing storage account not already being used by Functions.
6165

62-
1. Copy the connection string for this storage account. You need this string for later.
66+
1. Save the connection string for this storage account to use later.
6367

64-
1. [Create a file share](../storage/files/storage-how-to-create-file-share.md#create-a-file-share) in the new storage account. Try to use the same name as the file share in the existing storage account. Otherwise, you'll need to copy the name of the new file share to configure an app setting later.
68+
1. [Create a file share](../storage/files/storage-how-to-create-file-share.md#create-a-file-share) in the new storage account. For your convenience, you can use the same file share name from your original storage account. Otherwise, if you use a new file share name, you must update your app setting.
6569

6670
1. Secure the new storage account in one of the following ways:
6771

68-
* [Create a private endpoint](../storage/common/storage-private-endpoints.md#creating-a-private-endpoint). When you set up private endpoint connections, create private endpoints for the `file` and `blob` subresources. For Durable Functions, you must also make `queue` and `table` subresources accessible through private endpoints. If you're using a custom or on-premises DNS server, make sure you [configure your DNS server](../storage/common/storage-private-endpoints.md#dns-changes-for-private-endpoints) to resolve to the new private endpoints.
72+
* [Create a private endpoint](../storage/common/storage-private-endpoints.md#creating-a-private-endpoint). As you set up your private endpoint connection, create private endpoints for the `file` and `blob` subresources. For Durable Functions, you must also make `queue` and `table` subresources accessible through private endpoints. If you're using a custom or on-premises Domain Name System (DNS) server, [configure your DNS server](../storage/common/storage-private-endpoints.md#dns-changes-for-private-endpoints) to resolve to the new private endpoints.
6973

70-
* [Restrict traffic to specific subnets](../storage/common/storage-network-security.md#grant-access-from-a-virtual-network). Ensure that one of the allowed subnets is the one your function app is network integrated with. Double check that the subnet has a service endpoint to Microsoft.Storage.
74+
* [Restrict traffic to specific subnets](../storage/common/storage-network-security.md#grant-access-from-a-virtual-network). Ensure your function app is network integrated with an allowed subnet and that the subnet has a service endpoint to `Microsoft.Storage`.
7175

72-
1. Copy the file and blob content from the current storage account used by the function app to the newly secured storage account and file share. [AzCopy](../storage/common/storage-use-azcopy-blobs-copy.md) and [Azure Storage Explorer](https://techcommunity.microsoft.com/t5/azure-developer-community-blog/azure-tips-and-tricks-how-to-move-azure-storage-blobs-between/ba-p/3545304) are common methods. If you use Azure Storage Explorer, you may need to allow your client IP address into your storage account's firewall.
76+
1. Copy the file and blob content from the current storage account used by the function app to the newly secured storage account and file share. [AzCopy](../storage/common/storage-use-azcopy-blobs-copy.md) and [Azure Storage Explorer](https://techcommunity.microsoft.com/t5/azure-developer-community-blog/azure-tips-and-tricks-how-to-move-azure-storage-blobs-between/ba-p/3545304) are common methods. If you use Azure Storage Explorer, you might need to allow your client IP address access to your storage account's firewall.
7377

7478
Now you're ready to configure your function app to communicate with the newly secured storage account.
7579

7680
### 3. Enable application and configuration routing
7781

7882
> [!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.
83+
> These configuration steps are required only for the [Elastic Premium](./functions-premium-plan.md) and [Dedicated (App Service)](./dedicated-plan.md) hosting plans.
8084
> The [Flex Consumption plan](./flex-consumption-plan.md) doesn't require site settings to configure networking.
8185
82-
You should now route your function app's traffic to go through the virtual network.
86+
You're now ready to route your function app's traffic to go through the virtual network:
8387

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

86-
* Navigate to the **Networking** tab of your function app. Under **Outbound traffic configuration**, select the subnet associated with your virtual network integration.
90+
1. In your function app, expand **Settings**, and then select **Networking**. In the **Networking** page, under **Outbound traffic configuration**, select the subnet associated with your virtual network integration.
8791

88-
* In the new page, check the box for **Outbound internet traffic** under **Application routing**.
92+
1. In the new page, under **Application routing**, select **Outbound internet traffic**.
8993

90-
1. Enable [content share routing](../app-service/overview-vnet-integration.md#content-share) to have your function app communicate with your new storage account through its virtual network.
91-
92-
* In the same page, check the box for **Content storage** under **Configuration routing**.
94+
1. Enable [content share routing](../app-service/overview-vnet-integration.md#content-share) to enable your function app to communicate with your new storage account through its virtual network. In the same page as the previous step, under **Configuration routing**, select **Content storage**.
9395

9496
### 4. Update application settings
9597

96-
Finally, you need to update your application settings to point at the new secure storage account.
98+
Finally, you need to update your application settings to point to the new secure storage account:
9799

98-
1. Update the **Application Settings** under the **Configuration** tab of your function app to the following:
100+
1. In your function app, expand **Settings**, and then select **Environment variables**.
101+
1. In the **App settings** tab, update the following settings by selecting each setting, editing it, and then selecting **Apply**:
99102

100103
| Setting name | Value | Comment |
101104
|----|----|----|
102-
| [`AzureWebJobsStorage`](./functions-app-settings.md#azurewebjobsstorage)<br>[`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`](./functions-app-settings.md#website_contentazurefileconnectionstring) | Storage connection string | Both settings contain the connection string for the new secured storage account, which you saved earlier. |
103-
| [`WEBSITE_CONTENTSHARE`](./functions-app-settings.md#website_contentshare) | File share | The name of the file share created in the secured storage account where the project deployment files reside. |
105+
| [`AzureWebJobsStorage`](./functions-app-settings.md#azurewebjobsstorage)| Storage connection string | Use the connection string for your new secured storage account, which you saved earlier. |
106+
| [`WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`](./functions-app-settings.md#website_contentazurefileconnectionstring) | Storage connection string | Use the connection string for your new secured storage account, which you saved earlier. |
107+
| [`WEBSITE_CONTENTSHARE`](./functions-app-settings.md#website_contentshare) | File share | Use the name of the file share created in the secured storage account where the project deployment files reside. |
108+
109+
1. Select **Apply**, and then **Confirm** to save the new application settings in the function app.
104110

105-
1. Select **Save** to save the application settings. Changing app settings causes the app to restart.
111+
The function app restarts.
106112

107-
After the function app restarts, it's now connected to a secured storage account.
113+
After the function app finishes restarting, it connects to the secured storage account.
108114

109115
## Next steps
110116

0 commit comments

Comments
 (0)