Udostępnij za pośrednictwem


UserAssignedIdentityCollection.CreateOrUpdateAsync Method

Definition

Create or update an identity in the specified subscription and resource group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}
  • Operation Id: UserAssignedIdentities_CreateOrUpdate
  • Default Api Version: 2023-01-31
  • Resource: UserAssignedIdentityResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string resourceName, Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.ManagedServiceIdentities.UserAssignedIdentityResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, resourceName As String, data As UserAssignedIdentityData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of UserAssignedIdentityResource))

Parameters

waitUntil
WaitUntil

Completed if the method should wait to return until the long-running operation has completed on the service; Started if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.

resourceName
String

The name of the identity resource.

data
UserAssignedIdentityData

Parameters to create or update the identity.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

resourceName is an empty string, and was expected to be non-empty.

resourceName or data is null.

Applies to