ResourcesPolicyExtensions.GetById Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
The operation retrieves the policy assignment with the given ID. Policy assignment IDs have this format: '{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}'. 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}'. <item> Mocking. To mock this method, please mock GetById(String, CancellationToken) instead. </item>
public static Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource> GetById(this Azure.ResourceManager.Resources.TenantResource tenantResource, string policyAssignmentId, System.Threading.CancellationToken cancellationToken = default);
static member GetById : Azure.ResourceManager.Resources.TenantResource * string * System.Threading.CancellationToken -> Azure.Response<Azure.ResourceManager.Resources.Policy.PolicyAssignmentResource>
<Extension()>
Public Function GetById (tenantResource As TenantResource, policyAssignmentId As String, Optional cancellationToken As CancellationToken = Nothing) As 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.