azurepowershellazure-resource-managerazure-powershellaz

Azure - Disconnect VNet Integration in Powershell


Through the Azure portal I can disconnect my VNet integration, see below. I need to do this in a Powershell script, using the Az module. Is this possible?

enter image description here


Solution

  • Just use the command below, it works fine on my side.

    Remove-AzResource -ResourceGroupName "<resource-group-name>" -ResourceType "Microsoft.Web/sites/config" -ResourceName "<webapp-name>/virtualNetwork" -Force
    

    Or

    Remove-AzResource -ResourceId "/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Web/sites/<webapp-name>/config/virtualNetwork" -Force