共用方式為


IRoleAssignmentsOperations.CreateByIdWithHttpMessagesAsync 方法

定義

依識別碼建立或更新角色指派。

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Management.Authorization.Models.RoleAssignment>> CreateByIdWithHttpMessagesAsync (string roleAssignmentId, Microsoft.Azure.Management.Authorization.Models.RoleAssignmentCreateParameters parameters, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateByIdWithHttpMessagesAsync : string * Microsoft.Azure.Management.Authorization.Models.RoleAssignmentCreateParameters * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Management.Authorization.Models.RoleAssignment>>
Public Function CreateByIdWithHttpMessagesAsync (roleAssignmentId As String, parameters As RoleAssignmentCreateParameters, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AzureOperationResponse(Of RoleAssignment))

參數

roleAssignmentId
String

角色指派的完整識別碼,包括範圍、資源名稱和資源類型。 格式:/{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentName}。 範例:/subscriptions/ < SUB_ID > /resourcegroups/ < RESOURCE_GROUP > /providers/Microsoft.Authorization/roleAssignments/ < ROLE_ASSIGNMENT_NAME>

parameters
RoleAssignmentCreateParameters

角色指派的參數。

customHeaders
Dictionary<String,List<String>>

要新增至要求的標頭。

cancellationToken
CancellationToken

取消語彙基元。

傳回

例外狀況

當作業傳回不正確狀態碼時擲回

當作業傳回不正確狀態碼時擲回

無法還原序列化回應時擲回

當必要參數為 null 時擲回

適用於