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/functions-networking-options.md
+69-59Lines changed: 69 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
---
2
2
title: Azure Functions networking options
3
-
description: An overview of all networking options available in Azure Functions.
4
-
author: ggailey777
5
-
ms.topic: overview
3
+
description: Explore all supported Azure Functions networking features, including IP restrictions, private and service endpoints, and virtual network integration.
4
+
#customer intent: As a developer, I want to integrate my Azure Function app with a virtual network so that my app can securely access private resources.
5
+
ms.topic: concept-article
6
6
ms.date: 03/03/2026
7
-
ms.author: cachai
8
7
ms.custom:
9
8
- build-2024
10
9
- sfi-image-nochange
@@ -34,28 +33,31 @@ Use the following resources to quickly get started with Azure Functions networki
34
33
*[Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
35
34
*[Control Azure Functions outbound IP with an Azure virtual network NAT gateway](functions-how-to-use-nat-gateway.md).
36
35
37
-
## Inbound networking features
38
-
39
-
The following features let you filter inbound requests to your function app.
40
-
41
-
### Inbound access restrictions
36
+
## Inbound access restrictions
42
37
43
38
You can use access restrictions to define a priority-ordered list of IP addresses that are allowed or denied access to your app. The list can include IPv4 and IPv6 addresses, or specific virtual network subnets using [service endpoints](#use-service-endpoints). When there are one or more entries, an implicit "deny all" exists at the end of the list. IP restrictions work with all function-hosting options.
44
39
45
-
Access restrictions are available in the [Flex Consumption plan](flex-consumption-plan.md), [Elastic Premium](functions-premium-plan.md), [Consumption](consumption-plan.md), and [App Service](dedicated-plan.md).
40
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,consumption-plan"
46
41
47
42
> [!NOTE]
48
43
> With network restrictions in place, you can deploy only from within your virtual network, or when you put the IP address of the machine you're using to access the Azure portal on the **Safe Recipients** list. However, you can still manage the function using the portal.
49
44
50
45
To learn more, see [Azure App Service static access restrictions](../app-service/app-service-ip-restrictions.md).
51
46
52
-
### Private endpoints
47
+
::: zone-end
48
+
::: zone pivot="container-apps"
49
+
50
+
When running on [Container Apps](./functions-container-apps-hosting.md), inbound access is managed through the Container Apps environment ingress configuration rather than App Service access restrictions. For more information, see [IP restrictions in Azure Container Apps](../container-apps/ip-restrictions.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). For more details on using private endpoints with the storage account for your function app, visit [restrict your storage account to a virtual network](#restrict-your-storage-account-to-a-virtual-network).
57
59
58
-
###Service endpoints
60
+
## Service endpoints (inbound)
59
61
60
62
Using service endpoints, you can restrict many Azure services to selected virtual network subnets to provide a higher level of security. Regional virtual network 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. Follow these steps to access a secured service endpoint:
61
63
@@ -64,7 +66,7 @@ Using service endpoints, you can restrict many Azure services to selected virtua
64
66
65
67
To learn more, see [Virtual network service endpoints](../virtual-network/virtual-network-service-endpoints-overview.md).
66
68
67
-
####Use Service Endpoints
69
+
### Use Service Endpoints
68
70
69
71
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.
70
72
@@ -78,24 +80,34 @@ You can't use service endpoints to restrict access to apps that run in an App Se
78
80
79
81
To learn how to set up service endpoints, see [Establish Azure Functions private site access](functions-create-private-site-access.md).
80
82
81
-
## Outbound networking features
82
-
83
-
You can use the features in this section to manage outbound connections made by your app.
83
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,container-apps"
84
84
85
-
###Virtual network integration
85
+
## Virtual network integration (outbound)
86
86
87
87
This section details the features that Functions supports to control data outbound from your app.
88
88
89
89
Virtual network integration gives your function app access to resources in your virtual network. Once integrated, your app routes outbound traffic through the virtual network. This allows your app to access private endpoints or resources with rules allowing traffic from only select subnets. When the destination is an IP address outside of the virtual network, the source IP will still be sent from one of the addresses listed in your app's properties, unless you've configured a NAT Gateway.
90
90
91
+
::: zone-end
92
+
::: zone pivot="flex-consumption-plan,premium-plan,container-apps"
93
+
94
+
Azure Functions supports regional virtual network integration, which is the recommended approach. To learn how to set up virtual network integration, see [Enable virtual network integration](#enable-virtual-network-integration).
95
+
96
+
::: zone-end
97
+
::: zone pivot="dedicated-plan"
98
+
91
99
Azure Functions supports two kinds of virtual network integration:
92
100
93
-
*[Regional virtual network integration](#regional-virtual-network-integration)for apps running on the [Flex Consumption](./flex-consumption-plan.md), [Elastic Premium](./functions-premium-plan.md), [Dedicated (App Service)](./dedicated-plan.md), and [Container Apps](./functions-container-apps-hosting.md) hosting plans (recommended)
94
-
*[Gateway-required virtual network integration](../app-service/configure-gateway-required-vnet-integration.md) for apps running on the [Dedicated (App Service)](./dedicated-plan.md) hosting plan
Using regional virtual network integration enables your app to access:
101
113
@@ -116,11 +128,6 @@ When you use regional virtual network integration, you can use the following Azu
116
128
>
117
129
> Regional virtual network integration isn't able to use port 25.
118
130
119
-
::: zone pivot="consumption-plan"
120
-
121
-
> [!NOTE]
122
-
> The Consumption plan doesn't support virtual network integration. To use virtual network integration, consider hosting your function app instead in a [Flex Consumption](./flex-consumption-plan.md), [Elastic Premium](./functions-premium-plan.md), or [Dedicated (App Service)](./dedicated-plan.md) plan.
123
-
124
131
::: zone-end
125
132
::: zone pivot="flex-consumption-plan"
126
133
@@ -173,7 +180,8 @@ During the integration, your app is restarted. When integration is finished, you
173
180
174
181
If you prefer to only have your private traffic ([RFC1918](https://datatracker.ietf.org/doc/html/rfc1918#section-3) traffic) routed, follow the steps in this [App Service article](../app-service/overview-vnet-integration.md#application-routing).
175
182
176
-
::: zone-end
183
+
::: zone-end
184
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,container-apps"
177
185
178
186
### Subnets
179
187
@@ -190,12 +198,7 @@ The following table summarizes the subnet requirements for each hosting plan:
190
198
| Container Apps | Managed by environment | See [Container Apps networking](../container-apps/networking.md)| See [Container Apps networking](../container-apps/networking.md)|`Microsoft.App/environments`|
191
199
| Consumption | Not supported | N/A | N/A | N/A |
192
200
193
-
Make sure to select your hosting plan at the top of the article for plan-specific details.
194
-
195
-
::: zone pivot="consumption-plan"
196
-
197
-
The Consumption plan doesn't support virtual network integration, so subnet sizing guidance doesn't apply to this plan. To use virtual network integration, consider the [Flex Consumption plan](./flex-consumption-plan.md), [Elastic Premium plan](./functions-premium-plan.md), or [Dedicated (App Service) plan](./dedicated-plan.md).
198
-
201
+
Make sure to select your hosting plan at the top of the article for plan-specific details.
199
202
::: zone-end
200
203
::: zone pivot="container-apps"
201
204
@@ -270,7 +273,7 @@ Border Gateway Protocol (BGP) routes also affect your app traffic. If you have B
270
273
271
274
### Outbound IP restrictions
272
275
273
-
Outbound IP restrictions are available in a Flex Consumption plan, Elastic 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.
276
+
You can configure outbound restrictions for the virtual network where your App Service Environment is deployed.
274
277
275
278
When you integrate a function app in an Elastic 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 virtual network 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. For Flex Consumption, all traffic is already routed through the virtual network, and **Route All** isn't needed.
276
279
@@ -289,17 +292,11 @@ The following APIs let you programmatically manage regional virtual network inte
289
292
290
293
::: zone-end
291
294
292
-
## Hybrid Connections
293
-
294
-
[Hybrid Connections](../azure-relay/relay-hybrid-connections-protocol.md) is a feature of Azure Relay that you can use to access application resources in other networks. It provides access from your app to an application endpoint. You can't use it to access your application. Hybrid Connections is available to functions that run on Windows in all but the Consumption plan.
295
-
296
-
::: zone pivot="consumption-plan,flex-consumption-plan"
295
+
::: zone pivot="premium-plan,dedicated-plan,container-apps"
297
296
298
-
> [!NOTE]
299
-
> Hybrid Connections isn't supported on the Consumption or Flex Consumption plans. To use Hybrid Connections, consider the [Elastic Premium plan](./functions-premium-plan.md) or [Dedicated (App Service) plan](./dedicated-plan.md).
297
+
## Hybrid Connections
300
298
301
-
::: zone-end
302
-
::: zone pivot="premium-plan,dedicated-plan,container-apps"
299
+
[Hybrid Connections](../azure-relay/relay-hybrid-connections-protocol.md) is a feature of Azure Relay that you can use to access application resources in other networks. It provides access from your app to an application endpoint. You can't use it to access your application.
303
300
304
301
As used in Azure Functions, each hybrid connection correlates to a single TCP host and port combination. This means that the hybrid connection's endpoint can be on any operating system and any application as long as you're accessing a TCP listening port. The Hybrid Connections feature doesn't know or care what the application protocol is or what you're accessing. It just provides network access.
305
302
@@ -310,6 +307,8 @@ To learn more, see the [App Service documentation for Hybrid Connections](../app
310
307
311
308
::: zone-end
312
309
310
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,container-apps"
311
+
313
312
## Connecting to Azure Services through a virtual network
314
313
315
314
Virtual network integration enables your function app to access resources in a virtual network. This section overviews things you should consider when attempting to connect your app to certain services.
@@ -321,27 +320,38 @@ Virtual network integration enables your function app to access resources in a v
321
320
322
321
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.
323
322
324
-
You can use a network restricted storage account with function apps on the Flex Consumption, Elastic Premium, and Dedicated (App Service) plans; the Consumption plan isn't supported. For Elastic Premium and Dedicated plans, you have to ensure that private [content share routing](../app-service/configure-vnet-integration-routing.md#content-share) is configured. To learn how to configure your function app with a storage account secured with a virtual network, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
323
+
::: zone-end
324
+
::: zone pivot="flex-consumption-plan"
325
+
326
+
To learn how to configure your function app with a storage account secured with a virtual network, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
327
+
328
+
::: zone-end
329
+
::: zone pivot="premium-plan,dedicated-plan"
330
+
331
+
You must ensure that private [content share routing](../app-service/configure-vnet-integration-routing.md#content-share) is configured. To learn how to configure your function app with a storage account secured with a virtual network, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
332
+
333
+
::: zone-end
334
+
::: zone pivot="container-apps"
335
+
336
+
To learn how to configure your function app with a storage account secured with a virtual network, see [Restrict your storage account to a virtual network](configure-networking-how-to.md#restrict-your-storage-account-to-a-virtual-network).
337
+
338
+
::: zone-end
339
+
340
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,container-apps"
325
341
326
342
### Use Key Vault references
327
343
328
344
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.
329
345
330
346
If virtual network integration is configured for the app, [Key Vault references](../app-service/app-service-key-vault-references.md) can be used to retrieve secrets from a network-restricted vault.
331
347
332
-
### Virtual network triggers (non-HTTP)
333
-
334
-
Your workload might require your app to be triggered from an event source protected by a virtual network. There's two options if you want your app to dynamically scale based on the number of events received from non-HTTP trigger sources:
335
-
336
-
* Run your function app in a [Flex Consumption](./flex-consumption-plan.md).
337
-
* Run your function app in an [Elastic Premium plan](./functions-premium-plan.md), and enable virtual network trigger support.
348
+
::: zone-end
338
349
339
-
Function apps running on the [Dedicated (App Service)](./dedicated-plan.md) plans don't dynamically scale based on events. Rather, [autoscale](./dedicated-plan.md#scaling) rules you define dictate scale out.
350
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan,container-apps"
340
351
341
-
::: zone pivot="consumption-plan"
352
+
### Virtual network triggers (non-HTTP)
342
353
343
-
> [!NOTE]
344
-
> The Consumption plan doesn't support virtual network triggers. To use virtual network triggers with dynamic scaling, consider the [Flex Consumption plan](./flex-consumption-plan.md) or [Elastic Premium plan](./functions-premium-plan.md).
354
+
Your workload might require your app to be triggered from an event source protected by a virtual network.
345
355
346
356
::: zone-end
347
357
::: zone pivot="container-apps"
@@ -357,8 +367,6 @@ The Flex Consumption plan natively supports virtual network triggers. Your funct
357
367
::: zone-end
358
368
::: zone pivot="premium-plan"
359
369
360
-
#### Elastic Premium plan with virtual network triggers
361
-
362
370
The [Elastic Premium plan](functions-premium-plan.md) lets you create functions that trigger services secured by a virtual network. These non-HTTP triggers are known as _virtual network triggers_.
363
371
364
372
The Elastic Premium plan lets you create functions that trigger services secured by a virtual network.
@@ -414,15 +422,15 @@ The extensions in this table support dynamic scale monitoring of virtual network
414
422
::: zone-end
415
423
::: zone pivot="dedicated-plan"
416
424
417
-
#### App Service plan and App Service Environment with virtual network triggers
418
-
419
425
When your function app runs in either an App Service plan or an App Service Environment, you can write functions that resources secured by a virtual network trigger. For your functions to get triggered correctly, your app must be connected to a virtual network with access to the resource defined in the trigger connection.
420
426
421
427
For example, assume you want to configure Azure Cosmos DB to accept traffic only from a virtual network. In this case, you must deploy your function app in an App Service plan that provides virtual network integration with that virtual network. Integration enables that Azure Cosmos DB resource to trigger a function.
422
428
423
429
::: zone-end
424
430
425
-
## Testing considerations
431
+
::: zone pivot="flex-consumption-plan,premium-plan,dedicated-plan"
432
+
433
+
## Testing private endpoints
426
434
427
435
When testing functions in a function app with private endpoints, you must do your testing from within the same virtual network, such as on a virtual machine (VM) in that network. To use the **Code + Test** option in the portal from that VM, you need to add following [CORS origins](./functions-how-to-use-azure-function-app-settings.md?tabs=portal#cors) to your function app:
428
436
@@ -443,6 +451,8 @@ When you restrict access to your function app with private endpoints or any othe
443
451
444
452
1. Make sure the action is **Allow**, and set your desired name and priority.
@@ -461,7 +471,7 @@ You can also use the Network troubleshooter to resolve connection issues. To ope
461
471
462
472
**Subnet/VNet deletion issue** - This troubleshooter checks if your subnet has any locks and if it has any unused Service Association Links that might be blocking the deletion of the VNet/subnet.
463
473
464
-
## Next steps
474
+
## Related articles
465
475
466
476
To learn more about networking and Azure Functions:
0 commit comments