PolicyExemptionsOperationsExtensions.CreateOrUpdateAsync Method

Definition

Creates or updates a policy exemption.

public static System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.PolicyExemption> CreateOrUpdateAsync (this Microsoft.Azure.Management.ResourceManager.IPolicyExemptionsOperations operations, string scope, string policyExemptionName, Microsoft.Azure.Management.ResourceManager.Models.PolicyExemption parameters, System.Threading.CancellationToken cancellationToken = default);
static member CreateOrUpdateAsync : Microsoft.Azure.Management.ResourceManager.IPolicyExemptionsOperations * string * string * Microsoft.Azure.Management.ResourceManager.Models.PolicyExemption * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.PolicyExemption>
<Extension()>
Public Function CreateOrUpdateAsync (operations As IPolicyExemptionsOperations, scope As String, policyExemptionName As String, parameters As PolicyExemption, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PolicyExemption)

Parameters

operations
IPolicyExemptionsOperations

The operations group for this extension method.

scope
String

The scope of the policy exemption. Valid scopes are: management group (format: '/providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'

policyExemptionName
String

The name of the policy exemption to delete.

parameters
PolicyExemption

Parameters for the policy exemption.

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

This operation creates or updates a policy exemption with the given scope and name. Policy exemptions apply to all resources contained within their scope. For example, when you create a policy exemption at resource group scope for a policy assignment at the same or above level, the exemption exempts to all applicable resources in the resource group.

Applies to