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
Copy file name to clipboardExpand all lines: articles/azure-functions/configure-networking-how-to.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,6 @@ To set up a function with a storage account restricted to a private network:
44
44
|`WEBSITE_CONTENTSHARE`| File share | The name of the file share created in the secured storage account where the project deployment files reside. |
45
45
|`WEBSITE_CONTENTOVERVNET`| 1 | New setting |
46
46
|`WEBSITE_VNET_ROUTE_ALL`| 1 | Forces all outbound traffic through the virtual network. Required when the storage account is using private endpoint connections. |
47
-
|`WEBSITE_DNS_SERVER`|`168.63.129.16`| The DNS server used by the app. Required when the storage account is using private endpoint connections. |
48
47
49
48
1. Select **Save** to save the application settings. Changing app settings causes the app to restart.
Copy file name to clipboardExpand all lines: articles/azure-functions/functions-create-vnet.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,8 +320,7 @@ To use your function app with virtual networks, you need to join it to a subnet.
320
320
|**WEBSITE_CONTENTSHARE**| files | The name of the file share you created in the storage account. Use this setting with WEBSITE_CONTENTAZUREFILECONNECTIONSTRING. |
321
321
|**SERVICEBUS_CONNECTION**| myServiceBusConnectionString | Create this app setting for the connection string of your Service Bus. This storage connection string is from the [Get a Service Bus connection string](#get-a-service-bus-connection-string) section.|
322
322
|**WEBSITE_CONTENTOVERVNET**| 1 | Create this app setting. A value of 1 enables your function app to scale when your storage account is restricted to a virtual network. |
323
-
|**WEBSITE_DNS_SERVER**| 168.63.129.16 | Create this app setting. When your app integrates with a virtual network, it will use the same DNS server as the virtual network. Your function app needs this setting so it can work with Azure DNS private zones. It's required when you use private endpoints. This setting and WEBSITE_VNET_ROUTE_ALL will send all outbound calls from your app into your virtual network. |
324
-
|**WEBSITE_VNET_ROUTE_ALL**| 1 | Create this app setting. When your app integrates with a virtual network, it uses the same DNS server as the virtual network. Your function app needs this setting so it can work with Azure DNS private zones. It's required when you use private endpoints. This setting and WEBSITE_DNS_SERVER will send all outbound calls from your app into your virtual network. |
323
+
|**WEBSITE_VNET_ROUTE_ALL**| 1 | Create this app setting. When your app integrates with a virtual network, it uses the same DNS server as the virtual network. Your function app needs this setting so it can work with Azure DNS private zones. It's required when you use private endpoints. |
325
324
326
325
1. In the **Configuration** view, select the **Function runtime settings** tab.
To call other services that have a private endpoint connection, such as storage or service bus, be sure to configure your app to make [outbound calls to private endpoints](#private-endpoints).
44
+
39
45
### Use service endpoints
40
46
41
47
By using service endpoints, you can restrict access to selected Azure virtual network subnets. To restrict access to a specific subnet, create a restriction rule with a **Virtual Network** type. You can then select the subscription, virtual network, and subnet that you want to allow or deny access to.
@@ -50,12 +56,6 @@ You can't use service endpoints to restrict access to apps that run in an App Se
50
56
51
57
To learn how to set up service endpoints, see [Establish Azure Functions private site access](functions-create-private-site-access.md).
To call other services that have a private endpoint connection, such as storage or service bus, be sure to configure your app to make [outbound calls to private endpoints](#private-endpoints).
58
-
59
59
## Virtual network integration
60
60
61
61
Virtual network integration allows your function app to access resources inside a virtual network.
@@ -68,29 +68,132 @@ Virtual network integration in Azure Functions uses shared infrastructure with A
1. The drop-down list contains all of the Azure Resource Manager virtual networks in your subscription in the same region. Select the VNet you want to integrate with.
82
+
83
+
:::image type="content" source="./media/functions-networking-options/vnet-int-add-vnet-function-app.png" alt-text="Select the VNet":::
84
+
85
+
* The Functions Premium Plan only supports regional VNet integration. If the VNet is in the same region, either create a new subnet or select an empty, pre-existing subnet.
86
+
* To select a VNet in another region, you must have a VNet gateway provisioned with point to site enabled. VNet integration across regions is only supported for Dedicated plans.
87
+
88
+
During the integration, your app is restarted. When integration is finished, you'll see details on the VNet you're integrated with. By default, Route All will be enabled, and all traffic will be routed into your VNet.
89
+
90
+
If you wish for only your private traffic ([RFC1918](https://datatracker.ietf.org/doc/html/rfc1918#section-3) traffic) to be routed, please follow the steps in the [app service documentation](../app-service/web-sites-integrate-with-vnet.md#application-routing).
Using regional VNet Integration enables your app to access:
95
+
96
+
* Resources in a VNet in the same region as your app.
97
+
* Resources in VNets peered to the VNet your app is integrated with.
98
+
* Service endpoint secured services.
99
+
* Resources across Azure ExpressRoute connections.
100
+
* Resources in the VNet you're integrated with.
101
+
* Resources across peered connections, which include Azure ExpressRoute connections.
102
+
* Private endpoints
103
+
104
+
When you use VNet Integration with VNets in the same region, you can use the following Azure networking features:
105
+
106
+
***Network security groups (NSGs)**: You can block outbound traffic with an NSG that's placed on your integration subnet. The inbound rules don't apply because you can't use VNet Integration to provide inbound access to your app.
107
+
***Route tables (UDRs)**: You can place a route table on the integration subnet to send outbound traffic where you want.
108
+
109
+
> [!NOTE]
110
+
> When you route all of your outbound traffic into your VNet, it's subject to the NSGs and UDRs that are applied to your integration subnet. When VNet integrated, your function app's outbound traffic to public IP addresses is still sent from the addresses that are listed in your app properties, unless you provide routes that direct the traffic elsewhere.
111
+
>
112
+
> Regional VNet integration isn't able to use port 25.
113
+
114
+
There are some limitations with using VNet Integration with VNets in the same region:
76
115
77
-
## Connect to service endpoint secured resources
116
+
* You can't reach resources across global peering connections.
117
+
* The feature is available from all App Service scale units in Premium V2 and Premium V3. It's also available in Standard but only from newer App Service scale units. If you are on an older scale unit, you can only use the feature from a Premium V2 App Service plan. If you want to make sure you can use the feature in a Standard App Service plan, create your app in a Premium V3 App Service plan. Those plans are only supported on our newest scale units. You can scale down if you desire after that.
118
+
* The integration subnet can be used by only one App Service plan.
119
+
* The feature can't be used by Isolated plan apps that are in an App Service Environment.
120
+
* The feature requires an unused subnet that's a /28 or larger in an Azure Resource Manager VNet.
121
+
* The app and the VNet must be in the same region.
122
+
* You can't delete a VNet with an integrated app. Remove the integration before you delete the VNet.
123
+
* You can have only one regional VNet Integration per App Service plan. Multiple apps in the same App Service plan can use the same VNet.
124
+
* You can't change the subscription of an app or a plan while there's an app that's using regional VNet Integration.
125
+
* Your app can't resolve addresses in Azure DNS Private Zones without configuration changes.
78
126
79
-
To provide a higher level of security, you can restrict a number of Azure services to a virtual network by using service endpoints. You must then integrate your function app with that virtual network to access the resource. This configuration is supported on all [plans](functions-scale.md#networking-features) that support virtual network integration.
127
+
## Subnets
128
+
129
+
VNet Integration depends on a dedicated subnet. When you provision a subnet, the Azure subnet loses five IPs from the start. One address is used from the integration subnet for each plan instance. When you scale your app to four instances, then four addresses are used.
130
+
131
+
When you scale up or down in size, the required address space is doubled for a short period of time. This affects the real, available supported instances for a given subnet size. The following table shows both the maximum available addresses per CIDR block and the impact this has on horizontal scale:
132
+
133
+
| CIDR block size | Max available addresses | Max horizontal scale (instances)<sup>*</sup> |
<sup>*</sup>Assumes that you'll need to scale up or down in either size or SKU at some point.
140
+
141
+
Since subnet size can't be changed after assignment, use a subnet that's large enough to accommodate whatever scale your app might reach. To avoid any issues with subnet capacity for Functions Premium plans, you should use a /24 with 256 addresses for Windows and a /26 with 64 addresses for Linux.
142
+
143
+
When you want your apps in another plan to reach a VNet that's already connected to by apps in another plan, select a different subnet than the one being used by the pre-existing VNet Integration.
144
+
145
+
The feature is fully supported for both Windows and Linux apps, including [custom containers](../app-service/configure-custom-container.md). All of the behaviors act the same between Windows apps and Linux apps.
146
+
147
+
### Service endpoints
148
+
149
+
To provide a higher level of security, you can restrict a number of Azure services to a virtual network by using service endpoints. Regional VNet Integration enables your function app to reach Azure services that are secured with service endpoints. This configuration is supported on all [plans](functions-scale.md#networking-features) that support virtual network integration. To access a service endpoint-secured service, you must do the following:
150
+
151
+
1. Configure regional VNet Integration with your function app to connect to a specific subnet.
152
+
1. Go to the destination service and configure service endpoints against the integration subnet.
80
153
81
154
To learn more, see [Virtual network service endpoints](../virtual-network/virtual-network-service-endpoints-overview.md).
82
155
156
+
### Network security groups
157
+
158
+
You can use network security groups to block inbound and outbound traffic to resources in a VNet. An app that uses regional VNet integration can use a [network security group][VNETnsg] to block outbound traffic to resources in your VNet or the internet. To block traffic to public addresses, you must have VNet integration with Route All enabled. The inbound rules in an NSG don't apply to your app because VNet Integration affects only outbound traffic from your app.
159
+
160
+
To control inbound traffic to your app, use the Access Restrictions feature. An NSG that's applied to your integration subnet is in effect regardless of any routes applied to your integration subnet. If your function app is VNet integrated with Route All enabled, and you don't have any routes that affect public address traffic on your integration subnet, all of your outbound traffic is still subject to NSGs assigned to your integration subnet. When Route All isn't enabled, NSGs are only applied to RFC1918 traffic.
161
+
162
+
### Routes
163
+
164
+
You can use route tables to route outbound traffic from your app to wherever you want. By default, route tables only affect your RFC1918 destination traffic. When Route All is enabled, all of your outbound calls are affected. When [Route All](../app-service/web-sites-integrate-with-vnet.md#application-routing) is disabled, only private traffic (RFC1918) is affected by your route tables. Routes that are set on your integration subnet won't affect replies to inbound app requests. Common destinations can include firewall devices or gateways.
165
+
166
+
If you want to route all outbound traffic on-premises, you can use a route table to send all outbound traffic to your ExpressRoute gateway. If you do route traffic to a gateway, be sure to set routes in the external network to send any replies back.
167
+
168
+
Border Gateway Protocol (BGP) routes also affect your app traffic. If you have BGP routes from something like an ExpressRoute gateway, your app outbound traffic is affected. By default, BGP routes affect only your RFC1918 destination traffic. When your function app is VNet integrated with Route All enabled, all outbound traffic can be affected by your BGP routes.
169
+
170
+
### Azure DNS private zones
171
+
172
+
After your app integrates with your VNet, it uses the same DNS server that your VNet is configured with. By default, your app won't work with Azure DNS private zones. To work with Azure DNS private zones, you need to add the following app settings:
173
+
174
+
-`WEBSITE_VNET_ROUTE_ALL` with value `1`
175
+
176
+
This setting sends all of your outbound calls from your app into your VNet and enables your app to access an Azure DNS private zone. With these settings, your app can use Azure DNS by querying the DNS private zone at the worker level.
177
+
178
+
### Private Endpoints
179
+
180
+
If you want to make calls to [Private Endpoints][privateendpoints], then you must make sure that your DNS lookups resolve to the private endpoint. You can enforce this behavior in one of the following ways:
181
+
182
+
* Integrate with Azure DNS private zones. When your VNet doesn't have a custom DNS server, this is done automatically.
183
+
* Manage the private endpoint in the DNS server used by your app. To do this you must know the private endpoint address and then point the endpoint you are trying to reach to that address using an A record.
184
+
* Configure your own DNS server to forward to [Azure DNS private zones](#azure-dns-private-zones).
185
+
83
186
## Restrict your storage account to a virtual network
84
187
85
-
When you create a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. You can replace this storage account with one that is secured with service endpoints or private endpoint.
188
+
When you create a function app, you must create or link to a general-purpose Azure Storage account that supports Blob, Queue, and Table storage. You can replace this storage account with one that is secured with service endpoints or private endpoints.
86
189
87
190
This feature is supported for all Windows virtual network-supported SKUs in the Dedicated (App Service) plan and for the Premium plans. It is also supported with private DNS for Linux virtual network-supported SKUs. The Consumption plan and custom DNS on Linux plans aren't supported. To learn how to set up a function with a storage account restricted to a private network, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
88
191
89
192
## Use Key Vault references
90
193
91
194
You can use Azure Key Vault references to use secrets from Azure Key Vault in your Azure Functions application without requiring any code changes. Azure Key Vault is a service that provides centralized secrets management, with full control over access policies and audit history.
92
195
93
-
If virtual network integration is configured for the app, [Key Vault references](../app-service/app-service-key-vault-references.md) may be used to retireve secrets from a network-restricted vault.
196
+
If virtual network integration is configured for the app, [Key Vault references](../app-service/app-service-key-vault-references.md) may be used to retrieve secrets from a network-restricted vault.
94
197
95
198
## Virtual network triggers (non-HTTP)
96
199
@@ -148,7 +251,7 @@ To learn more, see the [App Service documentation for Hybrid Connections](../app
148
251
149
252
Outbound IP restrictions are available in a Premium plan, App Service plan, or App Service Environment. You can configure outbound restrictions for the virtual network where your App Service Environment is deployed.
150
253
151
-
When you integrate a function app in a Premium plan or an App Service plan with a virtual network, the app can still make outbound calls to the internet by default. By adding the application setting `WEBSITE_VNET_ROUTE_ALL=1`, you force all outbound traffic to be sent into your virtual network, where network security group rules can be used to restrict traffic.
254
+
When you integrate a function app in a Premium plan or an App Service plan with a virtual network, the app can still make outbound calls to the internet by default. By integrating your function app with a VNet with Route All enabled, you force all outbound traffic to be sent into your virtual network, where network security group rules can be used to restrict traffic.
152
255
153
256
To learn how to control the outbound IP using a virtual network, see [Tutorial: Control Azure Functions outbound IP with an Azure virtual network NAT gateway](functions-how-to-use-nat-gateway.md).
154
257
@@ -172,3 +275,8 @@ To learn more about networking and Azure Functions:
172
275
*[Learn more about virtual networks in Azure](../virtual-network/virtual-networks-overview.md)
173
276
*[Enable more networking features and control with App Service Environments](../app-service/environment/intro.md)
174
277
*[Connect to individual on-premises resources without firewall changes by using Hybrid Connections](../app-service/app-service-hybrid-connections.md)
0 commit comments