ResourcesPolicyExtensions.DeleteByIdAsync Method

Definition

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). <item> Mocking. To mock this method, please mock DeleteByIdAsync(String, CancellationToken) instead. </item>

public static System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource>> DeleteByIdAsync(this Azure.ResourceManager.Resources.TenantResource tenantResource, string policyAssignmentId, System.Threading.CancellationToken cancellationToken = default);
static member DeleteByIdAsync : Azure.ResourceManager.Resources.TenantResource * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource>>
<Extension()>
Public Function DeleteByIdAsync (tenantResource As TenantResource, policyAssignmentId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of PolicyAssignmentResource))

Parameters

tenantResource
TenantResource

The TenantResource the method will execute against.

policyAssignmentId
String

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

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

tenantResource is null.

Applies to