Skip to content

Commit a182678

Browse files
Merge pull request #176138 from madsd/vnet-int-rewrite
Rename/update vnet article and extract how-to.
2 parents b1ceab9 + 4dfb7dd commit a182678

17 files changed

+226
-202
lines changed

.openpublishing.redirection.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46532,6 +46532,11 @@
4653246532
"source_path_from_root": "/articles/azure-monitor/app/how-do-i.md",
4653346533
"redirect_url": "/azure/azure-monitor/faq",
4653446534
"redirect_document_id": false
46535+
},
46536+
{
46537+
"source_path_from_root": "/articles/app-service/web-sites-integrate-with-vnet.md",
46538+
"redirect_url": "/azure/app-service/overview-vnet-integration",
46539+
"redirect_document_id": false
4653546540
}
4653646541
]
4653746542
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
title: Enable integration with Azure virtual network.
3+
description: This how-to article will walk you through enabling virtual network integration on an App Service Web App
4+
keywords: vnet integration
5+
author: madsd
6+
ms.author: madsd
7+
ms.topic: how-to
8+
ms.date: 10/20/2021
9+
---
10+
11+
# Enable virtual network integration in Azure App Service
12+
13+
Through integrating with an Azure virtual network (VNet) from your [App Service app](./overview.md), you can reach private resources from your app within the virtual network. The VNet Integration feature has two variations:
14+
15+
* Regional VNet integration: Connect to Azure virtual networks in the same region. You must have a dedicated subnet in the VNet you're integrating with.
16+
* Gateway-required VNet integration: When you connect directly to VNet in other regions or to a classic virtual network in the same region, you must use the gateway-required VNet integration.
17+
18+
This how-to article will describe how to set up regional VNet integration.
19+
20+
## Prerequisites
21+
22+
The VNet Integration requires:
23+
- An App Service pricing tier [supporting VNet integration](./overview-vnet-integration.md).
24+
- A virtual network in the same region with an empty subnet.
25+
26+
The subnet must be delegated to Microsoft.Web/serverFarms. If the delegation isn't done before integration, the provisioning process will configure this delegation. The subnet must be allocated an IPv4 `/28` block (16 addresses). It is actually recommended to have a minimum of 64 addresses (IPv4 `/26` block) to allow for maximum horizontal scale.
27+
28+
## Configure in the Azure portal
29+
30+
1. Go to the **Networking** UI in the App Service portal. Under **Outbound Traffic**, select **VNet integration**.
31+
32+
1. Select **Add VNet**.
33+
34+
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-app.png" alt-text="Select VNet Integration":::
35+
36+
1. The drop-down list contains all of the virtual networks in your subscription in the same region.
37+
38+
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-add-vnet.png" alt-text="Select the VNet":::
39+
40+
* Select an empty pre-existing subnet or create a new subnet.
41+
42+
During the integration, your app is restarted. When integration is finished, you'll see details on the VNet you're integrated with.
43+
44+
## Configure with Azure CLI
45+
46+
You can also configure VNet integration using Azure CLI:
47+
48+
```azurecli-interactive
49+
az webapp vnet-integration add --resource-group <group-name> --name <app-name> --vnet <vnet-name> --subnet <subnet-name>
50+
```
51+
52+
> [!NOTE]
53+
> The command will check if subnet is delegated to Microsoft.Web/serverFarms and apply the necessary delegation if this is not configured. If this has already been configured, and you do not have permissions to check this, or the virtual network is in another subscription, you can use the `--skip-delegation-check` parameter to bypass the validation.
54+
55+
## Configure with Azure PowerShell
56+
57+
```azurepowershell
58+
# Parameters
59+
$siteName = '<app-name>'
60+
$resourceGroupName = '<group-name>'
61+
$vNetName = '<vnet-name>'
62+
$integrationSubnetName = '<subnet-name>'
63+
$subscriptionId = '<subscription-guid>'
64+
65+
# Configure VNet Integration
66+
$subnetResourceId = "/subscriptions/$subscriptionId/resourceGroups/$resourceGroupName/providers/Microsoft.Network/virtualNetworks/$vNetName/subnets/$integrationSubnetName"
67+
$webApp = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName $resourceGroupName -ResourceName $siteName
68+
$webApp.Properties.virtualNetworkSubnetId = $subnetResourceId
69+
$webApp | Set-AzResource -Force
70+
```
71+
72+
## Next steps
73+
74+
- [Configure VNet integration routing](./configure-vnet-integration-routing.md)
75+
- [General Networking overview](./networking-features.md)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Configure virtual network integration with application routing.
3+
description: This how-to article will walk you through configure app routing on a regional VNet integration.
4+
author: madsd
5+
ms.author: madsd
6+
ms.topic: how-to
7+
ms.date: 10/20/2021
8+
---
9+
10+
# Manage Azure App Service virtual network integration routing
11+
12+
When configuring application routing, you can either route all traffic or only private traffic (also known as [RFC1918](https://datatracker.ietf.org/doc/html/rfc1918#section-3) traffic) into your Azure virtual network (VNet). This how-to article will describe how to configure application routing.
13+
14+
## Prerequisites
15+
16+
Your app is already integrated using the regional VNet integration feature.
17+
18+
## Configure in the Azure portal
19+
20+
You can use the following steps to disable Route All in your app through the portal:
21+
22+
:::image type="content" source="./media/configure-vnet-integration-routing/vnetint-route-all-enabled.png" alt-text="Route All enabled":::
23+
24+
1. Go to the **Networking** > **VNet integration** UI in your app portal.
25+
1. Set **Route All** to Disabled.
26+
27+
:::image type="content" source="./media/configure-vnet-integration-routing/vnetint-route-all-disabling.png" alt-text="Disable Route All":::
28+
29+
1. Select **Yes** to confirm.
30+
31+
## Configure with Azure CLI
32+
33+
You can also configure Route All using Azure CLI (the minimum `az version` required is 2.27.0):
34+
35+
```azurecli-interactive
36+
az webapp config set --resource-group <group-name> --name <app-name> --vnet-route-all-enabled [true|false]
37+
```
38+
39+
## Configure with Azure PowerShell
40+
41+
```azurepowershell
42+
# Parameters
43+
$siteName = '<app-name>'
44+
$resourceGroupName = '<group-name>'
45+
46+
# Configure VNet Integration
47+
$webApp = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName $resourceGroupName -ResourceName $siteName
48+
Set-AzResource -ResourceId ($webApp.Id + "/config/web") -Properties @{ vnetRouteAllEnabled = $true } -Force
49+
```
50+
51+
## Next steps
52+
53+
- [Enable VNet integration](./configure-vnet-integration-enable.md)
54+
- [General Networking overview](./networking-features.md)

0 commit comments

Comments
 (0)