Unable to delete the DDoS protection plan

KapilAnanth 49,876 Reputation points Moderator
2025-04-24T10:00:00.9333333+00:00

I am using MSDN subscription, and I created DDOS protection plan on a Vnet. After my demo, I am trying to delete the DDOS plan.

For that I go the respective Vnet and then go to DDOS Network protection plan and select disable but after a while the DDOS Network Protection toggles to Enable.

How can I get rid of it as it is charging a lot? The subscription is in disabled state and all other resources are already deleted.

Azure DDoS Protection
Azure DDoS Protection

An Azure service that provides defense against distributed denial-of-service (DDoS) attacks.

0 comments No comments

Answer accepted by question author
UJTyagi-MSFT 1,095 Reputation points Microsoft Employee
2025-04-24T10:07:45.1166667+00:00

Hi @KapilAnanth-MSFT ,

  • DDoS protection plans cannot be deleted if they are associated with a virtual network. So the first step is to disassociate the virtual network from DDOS plan.
  • You can do it through Azure portal by going to virtual network > DDOS Network protection plan and select disable.
  • User's image
  • Or you can do it by going to Cloud PowerShell and run the below Powershell command
# Gets the most updated version of the virtual network 
$vnet = Get-AzVirtualNetwork -Name MyVnet -ResourceGroupName MyResourceGroup $vnet.DdosProtectionPlan = $null 
$vnet.EnableDdosProtection = $false 
$vnet | Set-AzVirtualNetwork

  • However, as you mentioned every time you disable the DDOS protection plan from the virtual network the setting is reenabled.
  • It seems, you are using Policy - Virtual networks should be protected by Azure DDoS Protection which re-enables the DDOS protection on the virtual network.
  • Hence, I advised you to exempt the policy on the virtual network and then disable the ddos plan.
  • User's image
  • Create an exemption as given in below snapshot for the given virtual network only

User's image

Policy Exemption using az cli 
az policy exemption create --name
                           [--description]
                           [--display-name]
                           [--exemption-category {Mitigated, Waiver}]
                           [--expires-on]
                           [--metadata]
                           [--policy-assignment]
                           [--policy-definition-reference-ids]
                           [--resource-group]
                           [--scope]
  • After policy exemption go ahead and disassociate the vnet from DDOS plan as performed in the previous step.
  • If you follow the plan, you should successfully be able to disable virtual network from the plan and would be able to delete the ddos protection plan.

Regards'

Ujjawal Tyagi

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Oldest

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.