|
1 | 1 | ---
|
2 |
| -title: Add or remove a subnet delegation in an Azure virtual network |
| 2 | +title: Add or Remove Subnet Delegation in Azure Virtual Network |
3 | 3 | titlesuffix: Azure Virtual Network
|
4 |
| -description: Learn how to add or remove a delegated subnet for a service in Azure. |
| 4 | +description: Learn how to add or remove subnet delegation in Azure virtual networks. Follow step-by-step instructions using Azure portal, PowerShell, or CLI to manage service-specific permissions. |
5 | 5 | services: virtual-network
|
6 | 6 | author: asudbring
|
7 | 7 | ms.service: azure-virtual-network
|
8 | 8 | ms.topic: how-to
|
9 |
| -ms.date: 04/21/2025 |
10 |
| -ms.author: allensu |
| 9 | +ms.date: 07/29/2025 |
| 10 | +ms.author: allensu |
11 | 11 | ms.custom: devx-track-azurepowershell, devx-track-azurecli
|
12 | 12 | # Customer intent: "As a network administrator, I want to add or remove subnet delegations in an Azure virtual network, so that I can manage service-specific permissions for resource deployment effectively."
|
13 | 13 | ---
|
14 | 14 |
|
15 |
| -# Add or remove a subnet delegation |
| 15 | +# Add or remove subnet delegation in Azure virtual network |
16 | 16 |
|
17 |
| -Subnet delegation gives explicit permissions to the service to create service-specific resources in the subnet using a unique identifier when deploying the service. This article describes how to add or remove a delegated subnet for an Azure service. |
| 17 | +Subnet delegation in Azure virtual networks gives explicit permissions to services to create service-specific resources in the subnet using a unique identifier when deploying the service. This article describes how to add or remove subnet delegation for Azure services, enabling you to manage network permissions effectively. |
18 | 18 |
|
19 | 19 | ## Prerequisites
|
20 | 20 |
|
@@ -69,14 +69,14 @@ The following example creates a resource group named **test-rg** in the **eastus
|
69 | 69 | $rg = @{
|
70 | 70 | Name = 'test-rg'
|
71 | 71 | Location = 'eastus2'
|
72 |
| -} |
| 72 | +} |
73 | 73 | New-AzResourceGroup @rg
|
74 | 74 | ```
|
75 | 75 | ### Create virtual network
|
76 | 76 |
|
77 |
| -Create a virtual network named **vnet-1** with a subnet named **subnet-1** using [`New-AzVirtualNetworkSubnetConfig`](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) in the **test-rg** using [`New-AzVirtualNetwork`](/powershell/module/az.network/new-azvirtualnetwork). |
| 77 | +Create a virtual network named **vnet-1** with a subnet named **subnet-1** using [`New-AzVirtualNetworkSubnetConfig`](/powershell/module/az.network/new-azvirtualnetworksubnetconfig) in the **test-rg** using [`New-AzVirtualNetwork`](/powershell/module/az.network/new-azvirtualnetwork). |
78 | 78 |
|
79 |
| -The IP address space for the virtual network is **10.0.0.0/16**. The subnet within the virtual network is **10.0.0.0/24**. |
| 79 | +The IP address space for the virtual network is **10.0.0.0/16**. The subnet within the virtual network is **10.0.0.0/24**. |
80 | 80 |
|
81 | 81 | ```azurepowershell-interactive
|
82 | 82 | $sub = @{
|
@@ -143,9 +143,9 @@ In this section, you delegate the subnet that you created in the preceding secti
|
143 | 143 |
|
144 | 144 | 1. Enter or select the following information:
|
145 | 145 |
|
146 |
| - | Setting | Value | |
147 |
| - | ------- | ----- | |
148 |
| - | **SUBNET DELEGATION** | | |
| 146 | + | Setting | Value | |
| 147 | + | ---------------------------- | --------------------------------------------------------------------------------------------------------------- | |
| 148 | + | **SUBNET DELEGATION** | | |
149 | 149 | | Delegate subnet to a service | Select the service that you want to delegate the subnet to. For example, **Microsoft.Sql/managedInstances**. |
|
150 | 150 |
|
151 | 151 | 1. Select **Save**.
|
@@ -182,7 +182,7 @@ Use [`Get-AzDelegation`](/powershell/module/az.network/get-azdelegation) to veri
|
182 | 182 | $sub = @{
|
183 | 183 | Name = 'vnet-1'
|
184 | 184 | ResourceGroupName = 'test-rg'
|
185 |
| -} |
| 185 | +} |
186 | 186 | $subnet = Get-AzVirtualNetwork @sub | Get-AzVirtualNetworkSubnetConfig -Name 'subnet-1'
|
187 | 187 |
|
188 | 188 | $dg = @{
|
@@ -261,9 +261,9 @@ In this section, you remove a subnet delegation for an Azure service.
|
261 | 261 |
|
262 | 262 | 1. Enter or select the following information:
|
263 | 263 |
|
264 |
| - | Setting | Value | |
265 |
| - | ------- | ----- | |
266 |
| - | **SUBNET DELEGATION** | | |
| 264 | + | Setting | Value | |
| 265 | + | ---------------------------- | ------------ | |
| 266 | + | **SUBNET DELEGATION** | | |
267 | 267 | | Delegate subnet to a service | Select **None**. |
|
268 | 268 |
|
269 | 269 | 1. Select **Save**.
|
@@ -299,14 +299,14 @@ Use [`Get-AzDelegation`](/powershell/module/az.network/get-azdelegation) to veri
|
299 | 299 | $sub = @{
|
300 | 300 | Name = 'vnet-1'
|
301 | 301 | ResourceGroupName = 'test-rg'
|
302 |
| -} |
| 302 | +} |
303 | 303 | $subnet = Get-AzVirtualNetwork @sub | Get-AzVirtualNetworkSubnetConfig -Name 'subnet-1'
|
304 | 304 |
|
305 | 305 | $dg = @{
|
306 | 306 | Name ='myDelegation'
|
307 | 307 | Subnet = $subnet
|
308 | 308 | }
|
309 |
| -Get-AzDelegation @dg |
| 309 | +Get-AzDelegation @dg |
310 | 310 | ```
|
311 | 311 | ```console
|
312 | 312 | Get-AzDelegation: Sequence contains no matching element
|
@@ -342,4 +342,5 @@ Output from command is a null bracket:
|
342 | 342 | [!INCLUDE [portal-clean-up.md](~/reusable-content/ce-skilling/azure/includes/portal-clean-up.md)]
|
343 | 343 |
|
344 | 344 | ## Next steps
|
| 345 | + |
345 | 346 | - Learn how to [manage subnets in Azure](virtual-network-manage-subnet.md).
|
0 commit comments