PolicyAssignmentsOperationsExtensions.CreateById(IPolicyAssignmentsOperations, String, PolicyAssignment) Method

Definition

Creates a policy assignment by ID.

public static Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment CreateById (this Microsoft.Azure.Management.ResourceManager.IPolicyAssignmentsOperations operations, string policyAssignmentId, Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment parameters);
static member CreateById : Microsoft.Azure.Management.ResourceManager.IPolicyAssignmentsOperations * string * Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment -> Microsoft.Azure.Management.ResourceManager.Models.PolicyAssignment
<Extension()>
Public Function CreateById (operations As IPolicyAssignmentsOperations, policyAssignmentId As String, parameters As PolicyAssignment) As PolicyAssignment

Parameters

operations
IPolicyAssignmentsOperations

The operations group for this extension method.

policyAssignmentId
System.String

The ID of the policy assignment to create. Use the format '/{scope}/providers/Microsoft.Authorization/policyAssignments/{policy-assignment-name}'.

parameters
PolicyAssignment

Parameters for policy assignment.

Returns

PolicyAssignment

Remarks

Policy assignments are inherited by child resources. For example, when you apply a policy to a resource group that policy is assigned to all resources in the group. When providing a scope for the assigment, use '/subscriptions/{subscription-id}/' for subscriptions, '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}' for resource groups, and '/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-provider-namespace}/{resource-type}/{resource-name}' for resources.

Applies to