> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Or Update Policy Exemption

Create or update a given policy exemption by its name.

<Note>
  External Documentation

  To learn more, visit the [Azure documentation](https://learn.microsoft.com/en-us/rest/api/policy-authorization/policy-exemptions/create-or-update?view=rest-policy-authorization-2023-04-01\&tabs=HTTP).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter      | Description                                                                                                                                                                                                                                                           |
  | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Assignment ID  | The ID of exemption assignment. This is the ID of the policy that will be exempt. You can find it in the overview of the policy in the Azure dashboard.                                                                                                               |
  | Exemption Name | The name of the policy exemption.                                                                                                                                                                                                                                     |
  | Exemption Type | The type of exemption.                                                                                                                                                                                                                                                |
  | Scope          | The scope of the policy exemption. For more information about policy exemptions scopes see [Azure documentation](https://learn.microsoft.com/en-us/rest/api/policy/policy-exemptions/create-or-update?view=rest-policy-2022-07-01-preview\&tabs=HTTP#uri-parameters). |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter             | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Description           | The description of the policy exemption.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  | Display Name          | The display name of the policy exemption.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
  | Expiry                | The expiry date of the policy exemption.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  | Metadata              | The policy exemption metadata. Metadata is an open ended object of key-value properties of the policy exemption.<br />For Example:<br /><pre><code>\{<br />  "reason": "Temporary exemption for an expensive VM demo"<br />}</code></pre>                                                                                                                                                                                                                                                                                                                         |
  | Policy Definition IDs | A comma-separated list of policy definition reference ID list when the policy assignment is an assignment of a policy set definition.                                                                                                                                                                                                                                                                                                                                                                                                                             |
  | Resource Selectors    | A list of [Resource Selector](https://learn.microsoft.com/en-us/rest/api/policy/policy-exemptions/create-or-update?view=rest-policy-2022-07-01-preview\&tabs=HTTP#resourceselector) objects of the policy exemption.<br />For Example:<br /><pre><code>\[<br />  \{<br />    "name": "SDPRegions",<br />    "selectors": <br />    \[<br />      \{<br />        "kind": "resourceLocation",<br />        "in": <br />        \[<br />          "eastus2euap",<br />          "centraluseuap"<br />        ]<br />      }<br />    ]<br />  }<br />]</code></pre> |
  | Scope Validation      | The assignment scope validation of the policy exemption.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
</div>

## Example Output

```json theme={"dark"}
{
	"properties": {
		"policyAssignmentId": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyAssignments/CostManagement",
		"policyDefinitionReferenceIds": [
			"Limit_Skus"
		],
		"exemptionCategory": "Waiver",
		"displayName": "Exempt demo cluster",
		"description": "Exempt demo cluster from limit sku",
		"metadata": {
			"reason": "Temporary exemption for an expensive VM demo"
		}
	},
	"systemData": {
		"createdBy": "string",
		"createdByType": "User",
		"createdAt": "2020-07-01T01:01:01.1075056Z",
		"lastModifiedBy": "string",
		"lastModifiedByType": "User",
		"lastModifiedAt": "2020-07-01T01:01:01.1075056Z"
	},
	"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/resourceGroups/demoCluster/providers/Microsoft.Authorization/policyExemptions/DemoExpensiveVM",
	"type": "Microsoft.Authorization/policyExemptions",
	"name": "DemoExpensiveVM"
}
```

## Workflow Library Example

[Create or Update Policy Exemption with Azure and Send Results Via Email](https://library.blinkops.com/workflows/create-or-update-policy-exemption-with-azure-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/create-or-update-policy-exemption-with-azure-and-send-results-via-email/canvas" />
</div>
