共用方式為


SshPublicKeyCollection.CreateOrUpdateAsync Method

Definition

Creates a new SSH public key resource.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}
  • Operation Id: SshPublicKeys_Create
  • Default Api Version: 2024-07-01
  • Resource: SshPublicKeyResource
public virtual System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SshPublicKeyResource>> CreateOrUpdateAsync (Azure.WaitUntil waitUntil, string sshPublicKeyName, Azure.ResourceManager.Compute.SshPublicKeyData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Compute.SshPublicKeyData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SshPublicKeyResource>>
override this.CreateOrUpdateAsync : Azure.WaitUntil * string * Azure.ResourceManager.Compute.SshPublicKeyData * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.SshPublicKeyResource>>
Public Overridable Function CreateOrUpdateAsync (waitUntil As WaitUntil, sshPublicKeyName As String, data As SshPublicKeyData, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ArmOperation(Of SshPublicKeyResource))

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.

sshPublicKeyName
String

The name of the SSH public key.

data
SshPublicKeyData

Parameters supplied to create the SSH public key.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

sshPublicKeyName or data is null.

Applies to