Condividi tramite


ArmResourcesPolicyModelFactory.PolicyAssignmentIdentity Method

Definition

Identity for the resource. Policy assignments support a maximum of one identity. That is either a system assigned identity or a single user assigned identity.

public static Azure.ResourceManager.Resources.Policy.Models.PolicyAssignmentIdentity PolicyAssignmentIdentity(Guid? principalId = default, Guid? tenantId = default, Azure.ResourceManager.Resources.Policy.Models.PolicyIdentityType? type = default, System.Collections.Generic.IDictionary<string,Azure.ResourceManager.Resources.Policy.Models.PolicyUserAssignedIdentity> userAssignedIdentities = default);
static member PolicyAssignmentIdentity : Nullable<Guid> * Nullable<Guid> * Nullable<Azure.ResourceManager.Resources.Policy.Models.PolicyIdentityType> * System.Collections.Generic.IDictionary<string, Azure.ResourceManager.Resources.Policy.Models.PolicyUserAssignedIdentity> -> Azure.ResourceManager.Resources.Policy.Models.PolicyAssignmentIdentity
Public Shared Function PolicyAssignmentIdentity (Optional principalId As Nullable(Of Guid) = Nothing, Optional tenantId As Nullable(Of Guid) = Nothing, Optional type As Nullable(Of PolicyIdentityType) = Nothing, Optional userAssignedIdentities As IDictionary(Of String, PolicyUserAssignedIdentity) = Nothing) As PolicyAssignmentIdentity

Parameters

principalId
Nullable<Guid>

The principal ID of the resource identity. This property will only be provided for a system assigned identity.

tenantId
Nullable<Guid>

The tenant ID of the resource identity. This property will only be provided for a system assigned identity.

type
Nullable<PolicyIdentityType>

The identity type. This is the only required field when adding a system or user assigned identity to a resource.

userAssignedIdentities
IDictionary<String,PolicyUserAssignedIdentity>

The user identity associated with the policy. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.

Returns

A new PolicyAssignmentIdentity instance for mocking.

Applies to