PolicyAssignmentCollection Class

Definition

A class representing a collection of PolicyAssignmentResource and their operations. Each PolicyAssignmentResource in the collection will belong to the same instance of ArmResource. To get a PolicyAssignmentCollection instance call the GetPolicyAssignments method from an instance of ArmResource.

public class PolicyAssignmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable<Azure.ResourceManager.Resources.PolicyAssignmentResource>, System.Collections.Generic.IEnumerable<Azure.ResourceManager.Resources.PolicyAssignmentResource>
type PolicyAssignmentCollection = class
    inherit ArmCollection
    interface seq<PolicyAssignmentResource>
    interface IEnumerable
    interface IAsyncEnumerable<PolicyAssignmentResource>
Public Class PolicyAssignmentCollection
Inherits ArmCollection
Implements IAsyncEnumerable(Of PolicyAssignmentResource), IEnumerable(Of PolicyAssignmentResource)
Inheritance
PolicyAssignmentCollection
Implements

Constructors

PolicyAssignmentCollection()

Initializes a new instance of the PolicyAssignmentCollection class for mocking.

Properties

Client

Gets the ArmClient this resource client was created from.

(Inherited from ArmCollection)
Diagnostics

Gets the diagnostic options for this resource client.

(Inherited from ArmCollection)
Endpoint

Gets the base uri for this resource client.

(Inherited from ArmCollection)
Id

Gets the resource identifier.

(Inherited from ArmCollection)
Pipeline

Gets the pipeline for this resource client.

(Inherited from ArmCollection)

Methods

CreateOrUpdate(WaitUntil, String, PolicyAssignmentData, CancellationToken)

This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Create
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
CreateOrUpdateAsync(WaitUntil, String, PolicyAssignmentData, CancellationToken)

This operation creates or updates a policy assignment with the given scope and name. Policy assignments apply to all resources contained within their scope. For example, when you assign a policy at resource group scope, that policy applies to all resources in the group.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Create
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
Exists(String, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Get
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
ExistsAsync(String, CancellationToken)

Checks to see if the resource exists in azure.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Get
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
Get(String, CancellationToken)

This operation retrieves a single policy assignment, given its name and the scope it was created at.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Get
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
GetAll(String, Nullable<Int32>, CancellationToken)

This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForResourceGroup
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForResource
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForManagementGroup
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_List
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
GetAllAsync(String, Nullable<Int32>, CancellationToken)

This operation retrieves the list of all policy assignments associated with the given resource group in the given subscription that match the optional given $filter. Valid values for $filter are: 'atScope()', 'atExactScope()' or 'policyDefinitionId eq '{value}''. If $filter is not provided, the unfiltered list includes all policy assignments associated with the resource group, including those that apply directly or apply from containing scopes, as well as any applied to resources contained within the resource group. If $filter=atScope() is provided, the returned list includes all policy assignments that apply to the resource group, which is everything in the unfiltered list except those applied to resources contained within the resource group. If $filter=atExactScope() is provided, the returned list only includes all policy assignments that at the resource group. If $filter=policyDefinitionId eq '{value}' is provided, the returned list includes all policy assignments of the policy definition whose id is {value} that apply to the resource group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForResourceGroup
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForResource
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_ListForManagementGroup
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
  • Request Path: /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments
  • Operation Id: PolicyAssignments_List
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
GetAsync(String, CancellationToken)

This operation retrieves a single policy assignment, given its name and the scope it was created at.

  • Request Path: /{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}
  • Operation Id: PolicyAssignments_Get
  • Default Api Version: 2022-06-01
  • Resource: PolicyAssignmentResource
GetIfExists(String, CancellationToken)

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
GetIfExistsAsync(String, CancellationToken)

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
TryGetApiVersion(ResourceType, String)

Gets the api version override if it has been set for the current client options.

(Inherited from ArmCollection)

Explicit Interface Implementations

IAsyncEnumerable<PolicyAssignmentResource>.GetAsyncEnumerator(CancellationToken)

Returns an enumerator that iterates asynchronously through the collection.

IEnumerable.GetEnumerator()

Returns an enumerator that iterates through a collection.

IEnumerable<PolicyAssignmentResource>.GetEnumerator()

Returns an enumerator that iterates through the collection.

Applies to