Skip to content

Commit e614a69

Browse files
committed
added Ameyas requests
1 parent 4580030 commit e614a69

2 files changed

Lines changed: 55 additions & 2 deletions

File tree

‎articles/defender-for-cloud/exempt-resource.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.topic: how-to
55
ms.custom: ignite-2023
66
ms.author: elkrieger
77
author: Elazark
8-
ms.date: 04/14/2026
8+
ms.date: 04/28/2026
99
---
1010

1111
# Exempt resources from recommendations
@@ -51,6 +51,8 @@ You need the following RBAC actions:
5151
5252
- Subscription-level permissions don't inherit upward to management groups. If the policy assignment is at the management group level, you need the role assigned at that level.
5353

54+
- To manage exemptions for specific resources, you need the required RBAC actions at the resource or resource group level. Subscription-scoped role assignments might not provide sufficient access to create or delete exemptions on individual resources. Verify that your role assignment covers the scope of the resource you want to exempt.
55+
5456
- Microsoft Cloud Security Benchmark (MCSB) must be assigned on the subscription.
5557

5658
> [!IMPORTANT]
@@ -78,6 +80,9 @@ You need the following RBAC actions:
7880

7981
- When you create an exemption at the management group level, ensure the *Windows Azure Security Resource Provider* has the necessary permissions by assigning it the **Reader** role on that management group. Grant this role the same way that you grant user permissions.
8082

83+
> [!TIP]
84+
> If you run into issues after you create an exemption, see [Review and manage recommendation exemptions](review-exemptions.md) for guidance on [resolving unhealthy status](review-exemptions.md#resolve-an-exemption-that-doesnt-update-the-recommendation-status), [permission errors at management group level](review-exemptions.md#resolve-permission-errors-at-management-group-level), [missing exemptions in the portal](review-exemptions.md#find-exemptions-that-arent-visible-in-the-portal), [deleting exemptions](review-exemptions.md#delete-an-exemption), and [cleaning up duplicate exemptions](review-exemptions.md#resolve-duplicate-or-conflicting-exemptions).
85+
8186
## Define an exemption
8287

8388
To create an exemption rule:

‎articles/defender-for-cloud/review-exemptions.md‎

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to review, manage, and delete recommendation exemptions i
44
ms.topic: how-to
55
ms.author: elkrieger
66
author: Elazark
7-
ms.date: 04/16/2026
7+
ms.date: 04/28/2026
88
#customer intent: As a user, I want to review and manage exempted resources in Microsoft Defender for Cloud so that I can keep my security posture accurate.
99
---
1010

@@ -96,6 +96,9 @@ policyresources
9696

9797
To delete an exemption, you need the `Microsoft.Authorization/policyExemptions/delete` permission at the scope where the exemption was created.
9898

99+
> [!IMPORTANT]
100+
> When you delete an exemption, Defender for Cloud re-evaluates the previously exempted resources. Resources that don't meet the recommendation requirements return to an **Unhealthy** state, which can lower your secure score. Allow up to 24 hours for the re-evaluation to complete.
101+
99102
If you receive a "Failed to delete the exemption(s)" error or a deleted exemption reappears:
100103

101104
- **Check permissions.** Verify that you have delete permissions at the scope where the exemption was created, not just at the subscription level.
@@ -135,6 +138,8 @@ If the recommendation still shows resources as unhealthy after 24 hours:
135138
136139
- **Verify exemption scope.** Ensure the exemption covers the specific resources that show as unhealthy. Check whether the exemption is at the correct scope level (management group, subscription, or resource).
137140
141+
- **Check resource-level permissions.** Subscription-scoped role assignments might not provide sufficient access to manage exemptions on individual resources. Verify that your RBAC role covers the resource or resource group level for the specific resource you want to exempt.
142+
138143
- **Check exemption type.** Waiver exemptions exclude resources from the secure score calculation, but resources might still show in recommendations. Mitigated exemptions should show resources as healthy.
139144
140145
- **Verify the recommendation evaluates the exempted policy.** Some recommendations are based on multiple policies. Ensure you exempted the correct underlying policy.
@@ -171,6 +176,49 @@ If previously visible exemptions no longer appear, or you can't find where exemp
171176
172177
- **Check permissions.** Ensure you have `Microsoft.Authorization/policyExemptions/read` permission at the correct scope level.
173178
179+
## Resolve duplicate or conflicting exemptions
180+
181+
Multiple exemptions on the same resource for the same recommendation can cause unexpected behavior, such as conflicting exemption types or statuses that don't update correctly. Maintain a single authoritative exemption per recommendation and resource combination.
182+
183+
### Identify duplicate exemptions
184+
185+
Run the following query in Azure Resource Graph Explorer to find resources with multiple exemptions:
186+
187+
```kusto
188+
policyresources
189+
| where type == "microsoft.authorization/policyexemptions"
190+
| where subscriptionId == "<your-subscription-id>"
191+
| summarize ExemptionCount = count(), ExemptionNames = make_list(name) by tostring(properties.policyAssignmentId), tostring(properties.resourceSelectors)
192+
| where ExemptionCount > 1
193+
```
194+
195+
### Clean up duplicate exemptions
196+
197+
1. Sign in to the [Azure portal](https://portal.azure.com/).
198+
199+
1. Go to **Defender for Cloud** > **Environment settings** > **Exemptions box**, or go to **Azure Policy** > **Exemptions**.
200+
201+
1. Filter by the affected subscription or resource group.
202+
203+
1. Review overlapping exemptions and decide which one to keep as the authoritative exemption.
204+
205+
1. Delete the extra exemptions.
206+
207+
To delete duplicate exemptions in bulk with PowerShell:
208+
209+
```azurepowershell-interactive
210+
# List all exemptions for a specific policy assignment
211+
$exemptions = Get-AzPolicyExemption -PolicyAssignmentIdFilter "<policy-assignment-id>"
212+
213+
# Review and remove duplicates (keep the first, remove the rest)
214+
$exemptions | Select-Object -Skip 1 | ForEach-Object {
215+
Remove-AzPolicyExemption -Id $_.Id -Force
216+
}
217+
```
218+
219+
> [!IMPORTANT]
220+
> After you clean up duplicate exemptions, allow up to 24 hours for Defender for Cloud to re-evaluate the affected resources. If the recommendation status doesn't update, verify that the remaining exemption has the correct scope and type.
221+
174222
## Get a notification when users create exemptions
175223

176224
To keep track of how users exempt resources from recommendations, we created an Azure Resource Manager template (ARM template). The template deploys a logic app playbook and all necessary API connections to notify you when an exemption is created.

0 commit comments

Comments
 (0)