Skip to content

Commit d50696a

Browse files
authored
Merge pull request #293763 from TimShererWithAquent/us345675-09
Freshness Edit: Azure App Service (9 of several)
2 parents b7df277 + 4544cbb commit d50696a

File tree

3 files changed

+46
-43
lines changed

3 files changed

+46
-43
lines changed

articles/app-service/configure-vnet-integration-enable.md

Lines changed: 46 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@ author: madsd
66
ms.author: madsd
77
ms.topic: how-to
88
ms.custom: devx-track-azurepowershell, devx-track-azurecli
9-
ms.date: 02/13/2023
9+
ms.date: 01/30/2025
1010
ms.tool: azure-cli, azure-powershell
11+
#customer intent: As a deployment engineer, I want to integrate web apps in Azure App Service with our Azure virtual networks.
1112
---
1213

1314
# Enable virtual network integration in Azure App Service
@@ -21,23 +22,25 @@ The virtual network integration feature requires:
2122
- An App Service pricing tier [that supports virtual network integration](./overview-vnet-integration.md).
2223
- A virtual network in the same region with an empty subnet.
2324

24-
The subnet must be delegated to Microsoft.Web/serverFarms. If the delegation isn't done before integration, the provisioning process configures this delegation. The subnet must be allocated an IPv4 `/28` block (16 addresses). We recommend that you have a minimum of 64 addresses (IPv4 `/26` block) to allow for maximum horizontal scale.
25+
The subnet must be delegated to Microsoft.Web/serverFarms. If you don't delegate before integration, the provisioning process configures this delegation. The subnet must be allocated an IPv4 `/28` block (16 addresses). We recommend that you have a minimum of 64 addresses (IPv4 `/26` block) to allow for maximum horizontal scale.
2526

26-
If the virtual network is in a different subscription than the app, you must ensure that the subscription with the virtual network is registered for the `Microsoft.Web` resource provider. You can explicitly register the provider [by following this documentation](../azure-resource-manager/management/resource-providers-and-types.md#register-resource-provider), but it's automatically registered when creating the first web app in a subscription.
27+
If the virtual network is in a different subscription than the app, ensure that the subscription with the virtual network is registered for the `Microsoft.Web` resource provider. The provider is registered when you create the first web app in a subscription. To explicitly register the provider, see [Register resource provider](../azure-resource-manager/management/resource-providers-and-types.md#register-resource-provider).
2728

2829
## Configure in the Azure portal
2930

30-
1. Go to **Networking** in the App Service portal. Under **Outbound traffic configuration**, select **Virtual network integration**.
31+
1. Go to your app in the Azure portal. Select **Settings** > **Networking**. Under **Outbound traffic configuration**, next to **Virtual network integration**, select the **Not configured** link.
3132

3233
1. Select **Add virtual network integration**.
3334

34-
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-app.png" alt-text="Screenshot that shows selecting Virtual network integration.":::
35+
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-app.png" alt-text="Screenshot that shows selecting Virtual network integration.":::
3536

36-
1. The dropdown list contains all the virtual networks in your subscription in the same region. Select an empty pre-existing subnet or create a new subnet.
37+
1. Select a subscription and virtual network.
3738

38-
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-add-vnet.png" alt-text="Screenshot that shows selecting the virtual network.":::
39+
1. Under **Subnet**, the dropdown list contains all the virtual networks in your subscription in the same region. Select an empty preexisting subnet or create a new subnet. Select **Connect**.
3940

40-
During the integration, your app is restarted. When integration is finished, you see details on the virtual network you're integrated with.
41+
:::image type="content" source="./media/configure-vnet-integration-enable/vnetint-add-vnet.png" alt-text="Screenshot that shows selecting the virtual network.":::
42+
43+
During the integration, your app is restarted. When integration finishes, you see details on the virtual network that you integrated with.
4144

4245
## Configure with the Azure CLI
4346

@@ -48,53 +51,53 @@ az webapp vnet-integration add --resource-group <group-name> --name <app-name> -
4851
```
4952

5053
> [!NOTE]
51-
> The command checks if the subnet is delegated to Microsoft.Web/serverFarms and applies the necessary delegation if it isn't configured. If the subnet was configured, and you don't have permissions to check it, or if the virtual network is in another subscription, you can use the `--skip-delegation-check` parameter to bypass the validation.
54+
> The command checks if the subnet is delegated to Microsoft.Web/serverFarms. If it isn't configured, the command applies the necessary delegation. If the subnet was configured and you don't have permissions to check it, or if the virtual network is in another subscription, you can use the `--skip-delegation-check` parameter to bypass the validation.
5255
5356
## Configure with Azure PowerShell
5457

55-
Prepare parameters.
58+
1. Prepare parameters.
5659

57-
```azurepowershell
58-
$siteName = '<app-name>'
59-
$vNetResourceGroupName = '<group-name>'
60-
$webAppResourceGroupName = '<group-name>'
61-
$vNetName = '<vnet-name>'
62-
$integrationSubnetName = '<subnet-name>'
63-
$vNetSubscriptionId = '<subscription-guid>'
64-
```
60+
```azurepowershell
61+
$siteName = '<app-name>'
62+
$vNetResourceGroupName = '<group-name>'
63+
$webAppResourceGroupName = '<group-name>'
64+
$vNetName = '<vnet-name>'
65+
$integrationSubnetName = '<subnet-name>'
66+
$vNetSubscriptionId = '<subscription-guid>'
67+
```
6568

66-
> [!NOTE]
67-
> If the virtual network is in another subscription than webapp, you can use the *Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"* command to set the current subscription context. Set the current subscription context to the subscription where the virtual network was deployed.
69+
> [!NOTE]
70+
> If the virtual network is in another subscription than webapp, you can use the `Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"` command to set the current subscription context. Set the current subscription context to the subscription where the virtual network was deployed.
6871
69-
Check if the subnet is delegated to Microsoft.Web/serverFarms.
72+
1. Check if the subnet is delegated to Microsoft.Web/serverFarms.
7073

71-
```azurepowershell
72-
$vnet = Get-AzVirtualNetwork -Name $vNetName -ResourceGroupName $vNetResourceGroupName
73-
$subnet = Get-AzVirtualNetworkSubnetConfig -Name $integrationSubnetName -VirtualNetwork $vnet
74-
Get-AzDelegation -Subnet $subnet
75-
```
74+
```azurepowershell
75+
$vnet = Get-AzVirtualNetwork -Name $vNetName -ResourceGroupName $vNetResourceGroupName
76+
$subnet = Get-AzVirtualNetworkSubnetConfig -Name $integrationSubnetName -VirtualNetwork $vnet
77+
Get-AzDelegation -Subnet $subnet
78+
```
7679

77-
If your subnet isn't delegated to Microsoft.Web/serverFarms, add delegation using below commands.
80+
1. If your subnet isn't delegated to Microsoft.Web/serverFarms, add delegation using these commands.
7881

79-
```azurepowershell
80-
$subnet = Add-AzDelegation -Name "myDelegation" -ServiceName "Microsoft.Web/serverFarms" -Subnet $subnet
81-
Set-AzVirtualNetwork -VirtualNetwork $vnet
82-
```
82+
```azurepowershell
83+
$subnet = Add-AzDelegation -Name "myDelegation" -ServiceName "Microsoft.Web/serverFarms" -Subnet $subnet
84+
Set-AzVirtualNetwork -VirtualNetwork $vnet
85+
```
8386

84-
Configure virtual network integration.
87+
1. Configure virtual network integration.
8588

86-
> [!NOTE]
87-
> If the webapp is in another subscription than virtual network, you can use the *Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"* command to set the current subscription context. Set the current subscription context to the subscription where the web app was deployed.
88-
89-
```azurepowershell
90-
$subnetResourceId = "/subscriptions/$vNetSubscriptionId/resourceGroups/$vNetResourceGroupName/providers/Microsoft.Network/virtualNetworks/$vNetName/subnets/$integrationSubnetName"
91-
$webApp = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName $webAppResourceGroupName -ResourceName $siteName
92-
$webApp.Properties.virtualNetworkSubnetId = $subnetResourceId
93-
$webApp.Properties.vnetRouteAllEnabled = 'true'
94-
$webApp | Set-AzResource -Force
95-
```
89+
```azurepowershell
90+
$subnetResourceId = "/subscriptions/$vNetSubscriptionId/resourceGroups/$vNetResourceGroupName/providers/Microsoft.Network/virtualNetworks/$vNetName/subnets/$integrationSubnetName"
91+
$webApp = Get-AzResource -ResourceType Microsoft.Web/sites -ResourceGroupName $webAppResourceGroupName -ResourceName $siteName
92+
$webApp.Properties.virtualNetworkSubnetId = $subnetResourceId
93+
$webApp.Properties.vnetRouteAllEnabled = 'true'
94+
$webApp | Set-AzResource -Force
95+
```
96+
97+
> [!NOTE]
98+
> If the webapp is in another subscription than virtual network, you can use the `Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx"` command to set the current subscription context. Set the current subscription context to the subscription where the web app was deployed.
9699
97-
## Next steps
100+
## Related content
98101

99102
- [Configure virtual network integration routing](./configure-vnet-integration-routing.md)
100103
- [General networking overview](./networking-features.md)
-10.6 KB
Loading
-614 Bytes
Loading

0 commit comments

Comments
 (0)