Share via


SqlDistributedAvailabilityGroupResource.SetRoleAsync Method

Definition

Sets the role for managed instance in a distributed availability group.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole
  • Operation Id: DistributedAvailabilityGroups_SetRole
  • Default Api Version: 2023-08-01
  • Resource: SqlDistributedAvailabilityGroupResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Sql.SqlDistributedAvailabilityGroupResource>> SetRoleAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole distributedAvailabilityGroupSetRole, System.Threading.CancellationToken cancellationToken = default);
abstract member SetRoleAsync : Azure.WaitUntil * Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Sql.SqlDistributedAvailabilityGroupResource>>
override this.SetRoleAsync : Azure.WaitUntil * Azure.ResourceManager.Sql.Models.DistributedAvailabilityGroupSetRole * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Sql.SqlDistributedAvailabilityGroupResource>>
Public Overridable Function SetRoleAsync (waitUntil As WaitUntil, distributedAvailabilityGroupSetRole As DistributedAvailabilityGroupSetRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of SqlDistributedAvailabilityGroupResource))

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.

distributedAvailabilityGroupSetRole
DistributedAvailabilityGroupSetRole

The distributed availability group set role request parameters.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

distributedAvailabilityGroupSetRole is null.

Applies to