你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
CognitiveServicesAccount.CreateRoleAssignment 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.
Overloads
CreateRoleAssignment(CognitiveServicesBuiltInRole, UserAssignedIdentity) |
Creates a role assignment for a user-assigned identity that grants access to this CognitiveServicesAccount. |
CreateRoleAssignment(CognitiveServicesBuiltInRole, BicepValue<RoleManagementPrincipalType>, BicepValue<Guid>, String) |
Creates a role assignment for a principal that grants access to this CognitiveServicesAccount. |
CreateRoleAssignment(CognitiveServicesBuiltInRole, UserAssignedIdentity)
- Source:
- CognitiveServicesAccount.cs
- Source:
- CognitiveServicesAccount.cs
Creates a role assignment for a user-assigned identity that grants access to this CognitiveServicesAccount.
public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment (Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity);
member this.CreateRoleAssignment : Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole * Azure.Provisioning.Roles.UserAssignedIdentity -> Azure.Provisioning.Authorization.RoleAssignment
Public Function CreateRoleAssignment (role As CognitiveServicesBuiltInRole, identity As UserAssignedIdentity) As RoleAssignment
Parameters
The role to grant.
- identity
- UserAssignedIdentity
The UserAssignedIdentity.
Returns
The RoleAssignment.
Applies to
CreateRoleAssignment(CognitiveServicesBuiltInRole, BicepValue<RoleManagementPrincipalType>, BicepValue<Guid>, String)
- Source:
- CognitiveServicesAccount.cs
- Source:
- CognitiveServicesAccount.cs
Creates a role assignment for a principal that grants access to this CognitiveServicesAccount.
public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment (Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.BicepValue<Azure.Provisioning.Authorization.RoleManagementPrincipalType> principalType, Azure.Provisioning.BicepValue<Guid> principalId, string? bicepIdentifierSuffix = default);
public Azure.Provisioning.Authorization.RoleAssignment CreateRoleAssignment (Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole role, Azure.Provisioning.BicepValue<Azure.Provisioning.Authorization.RoleManagementPrincipalType> principalType, Azure.Provisioning.BicepValue<Guid> principalId, string? identifierNameSuffix = default);
member this.CreateRoleAssignment : Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole * Azure.Provisioning.BicepValue<Azure.Provisioning.Authorization.RoleManagementPrincipalType> * Azure.Provisioning.BicepValue<Guid> * string -> Azure.Provisioning.Authorization.RoleAssignment
member this.CreateRoleAssignment : Azure.Provisioning.CognitiveServices.CognitiveServicesBuiltInRole * Azure.Provisioning.BicepValue<Azure.Provisioning.Authorization.RoleManagementPrincipalType> * Azure.Provisioning.BicepValue<Guid> * string -> Azure.Provisioning.Authorization.RoleAssignment
Public Function CreateRoleAssignment (role As CognitiveServicesBuiltInRole, principalType As BicepValue(Of RoleManagementPrincipalType), principalId As BicepValue(Of Guid), Optional bicepIdentifierSuffix As String = Nothing) As RoleAssignment
Public Function CreateRoleAssignment (role As CognitiveServicesBuiltInRole, principalType As BicepValue(Of RoleManagementPrincipalType), principalId As BicepValue(Of Guid), Optional identifierNameSuffix As String = Nothing) As RoleAssignment
Parameters
The role to grant.
- principalType
- BicepValue<RoleManagementPrincipalType>
The type of the principal to assign to.
- principalId
- BicepValue<Guid>
The principal to assign to.
- bicepIdentifierSuffixidentifierNameSuffix
- String
Optional role assignment identifier name suffix.
Returns
The RoleAssignment.