Dela via


PolicyAssignmentsOperationsExtensions.DeleteByIdAsync Method

Definition

Deletes a policy assignment.

public static System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment> DeleteByIdAsync (this Microsoft.Azure.Management.ResourceManager.IPolicyAssignmentsOperations operations, string policyAssignmentId, System.Threading.CancellationToken cancellationToken = default);
static member DeleteByIdAsync : Microsoft.Azure.Management.ResourceManager.IPolicyAssignmentsOperations * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment>
<Extension()>
Public Function DeleteByIdAsync (operations As IPolicyAssignmentsOperations, policyAssignmentId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of PolicyAssignment)

Parameters

operations
IPolicyAssignmentsOperations

The operations group for this extension method.

policyAssignmentId
String

The ID of the policy assignment to delete. Use the format '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'.

cancellationToken
CancellationToken

The cancellation token.

Returns

Remarks

This operation deletes the policy with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. Valid formats for {scope} are: '/providers/Microsoft.Management/managementGroups/{managementGroup}' (management group), '/subscriptions/{subscriptionId}' (subscription), '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' (resource group), or '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}' (resource).

Applies to