MockableResourcesPolicyTenantResource.DeleteById 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).

  • Request Path. : /{policyAssignmentId}.
  • Operation Id. : Authorization_DeleteById.
  • Default Api Version. : 2025-12-01-preview.
public virtual Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource> DeleteById(string policyAssignmentId, System.Threading.CancellationToken cancellationToken = default);
abstract member DeleteById : string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource>
override this.DeleteById : string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource>
Public Overridable Function DeleteById (policyAssignmentId As String, Optional cancellationToken As CancellationToken = Nothing) As Response(Of PolicyAssignmentResource)

Parameters

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

policyAssignmentId is null.

policyAssignmentId is an empty string, and was expected to be non-empty.

Applies to