Udostępnij za pośrednictwem


IRoleAssignmentsOperations.CreateWithHttpMessagesAsync Metoda

Definicja

Utwórz lub zaktualizuj przypisanie roli według zakresu i nazwy.

public System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<Microsoft.Azure.Management.Authorization.Models.RoleAssignment>> CreateWithHttpMessagesAsync (string scope, string roleAssignmentName, 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 CreateWithHttpMessagesAsync : string * 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 CreateWithHttpMessagesAsync (scope As String, roleAssignmentName 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))

Parametry

scope
String

Zakres operacji lub zasobu. Prawidłowe zakresy to: subskrypcja (format: "/subscriptions/{subscriptionId}"), grupa zasobów (format: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}" lub zasób (format: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}"

roleAssignmentName
String

Nazwa przypisania roli. Może to być dowolny prawidłowy identyfikator GUID.

parameters
RoleAssignmentCreateParameters

Parametry przypisania roli.

customHeaders
Dictionary<String,List<String>>

Nagłówki, które zostaną dodane do żądania.

cancellationToken
CancellationToken

Token anulowania.

Zwraca

Wyjątki

Zgłaszany, gdy operacja zwróciła nieprawidłowy kod stanu

Zgłaszany, gdy operacja zwróciła nieprawidłowy kod stanu

Zgłaszany, gdy nie można wykonać deserializacji odpowiedzi

Zgłaszany, gdy wymagany parametr ma wartość null

Dotyczy