How to deactivate Microsoft Defender for Endpoint in Azure for a specific resource group?

Hotak, Mustafa 0 Reputation points
2025-04-30T15:16:33.4266667+00:00

Hello community,

We are currently using Microsoft Defender for Servers – Plan 2 in Azure, which is active and enforced at the subscription level. We have a use case where we need to exclude or deactivate Defender for Endpoint (MDE) for a specific resource group—namely, rg-kitaplus.

Here are the key details:

Subscription ID: xxxxxxxxxxxxxxxxxxxxxx

Defender Plan: Plan 2 ($15/server/month)

Scope to exclude: Resource group rg-kitaplus

Current behavior:

When we try to apply a policy that disables Defender for Servers using the pricingTier: Free for tagged resources, the remediation deployment fails.

The error is:

json Kopieren Bearbeiten { "code": "EnforcementConflict", "message": "Update resource plan is not allowed because the parent subscription enforces its pricing plan configuration. To allow an update on resource level, change the pricing plan enforcement value of the parent subscription to False" } 🔍 What I've Tried Deployed a policy targeting Microsoft.Security/pricings with pricingTier = Free on tagged VMs.

Verified that Plan 2 is applied at the subscription level.

Found no direct option in the Azure Portal to disable "enforcement mode."

Reviewed the policy definition: Built-in Policy - Disable Defender for Servers based on tag

❓ Questions Is it possible to deactivate or exclude Microsoft Defender for Endpoint for specific resource groups or VMs when Plan 2 is enforced?

Where and how can we disable the enforcementMode at the subscription level to allow resource-level overrides?

If this enforcement setting is not available in the Portal, can it be safely changed using the Azure REST API or CLI?

If so, what’s the exact call to modify enforcementMode?

What are the implications (billing, security, compliance) of disabling enforcement and handling exclusions at the resource level?

🎯 Goal We want to retain Plan 2 for most workloads while excluding a small subset (e.g., non-production resource groups) for cost control and testing purposes.

Any guidance, best practices, or official documentation references would be greatly appreciated!

Best regards, Mustafa Hotak

Microsoft Defender for Cloud
Microsoft Defender for Cloud
An Azure service that provides threat protection for workloads running in Azure, on-premises, and in other clouds. Previously known as Azure Security Center and Azure Defender.
1,531 questions
{count} votes

Your answer

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