Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

Remove-AzDelegation

Removes a service delegation from the provided subnet.

Syntax

Default (Default)

Remove-AzDelegation
 -Name <String>
 -Subnet <PSSubnet>
 [-DefaultProfile <IAzureContextContainer>]
 [<CommonParameters>]

Description

The Remove-AzDelegation cmdlet takes in a Subnet with delegations and removes the named delegation from that subnet.

Examples

Example 1

# Add a delegation to an existing subnet
$vnet = Get-AzVirtualNetwork -Name "myVNet" -ResourceGroupName "myResourceGroup"
$subnet = Get-AzVirtualNetworkSubnetConfig -Name "mySubnet" -VirtualNetwork $vnet
$subnet = Add-AzDelegation -Name "myDelegation" -ServiceName "Microsoft.Sql/servers" -Subnet $subnet
Set-AzVirtualNetwork -VirtualNetwork $vnet

# Remove the delegation
$vnet = Get-AzVirtualNetwork -Name "myVNet" -ResourceGroupName "myResourceGroup"
$subnet = Get-AzVirtualNetworkSubnetConfig -Name "mySubnet" -VirtualNetwork $vnet
$subnet = Remove-AzDelegation -Name "myDelegation" -Subnet $subnet
Set-AzVirtualNetwork -VirtualNetwork $vnet

In this example, the first half (found under "Add a delegation to an existing subnet") is identical to Add-AzDelegation. In the second half, the first two cmdlets retrieve the subnet of interest, refreshing the local copy with what's on the server. The third cmdlet removes the delegation that was created in the first half from mySubnet and stores the updated subnet in $subnet. The final cmdlet updates the server with the removed delegation.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

-Name

The name of the delegation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

-Subnet

The subnet from which to remove the delegation

Parameter properties

Type:PSSubnet
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

PSSubnet

Outputs

PSSubnet

Related Links


Feedback

Was this page helpful?