Share via


PolicyAssignmentCollection.GetIfExists(String, CancellationToken) Method

Definition

Tries to get details for this resource from the service.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Get
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
public virtual Azure.NullableResponse<Azure.ResourceManager.Resources.PolicyAssignmentResource> GetIfExists (string policyAssignmentName, System.Threading.CancellationToken cancellationToken = default);
abstract member GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.Resources.PolicyAssignmentResource>
override this.GetIfExists : string * System.Threading.CancellationToken -> Azure.NullableResponse<Azure.ResourceManager.Resources.PolicyAssignmentResource>
Public Overridable Function GetIfExists (policyAssignmentName As String, Optional cancellationToken As CancellationToken = Nothing) As NullableResponse(Of PolicyAssignmentResource)

Parameters

policyAssignmentName
String

The name of the policy assignment to get.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

policyAssignmentName is null.

Applies to