ManagedDiskCollection.CreateOrUpdate Method

Definition

Creates or updates a disk.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}
  • Operation Id: Disks_CreateOrUpdate
  • Default Api Version: 2023-10-02
  • Resource: ManagedDiskResource
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.ManagedDiskResource> CreateOrUpdate (Azure.WaitUntil waitUntil, string diskName, Azure.ResourceManager.Compute.ManagedDiskData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Compute.ManagedDiskData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.ManagedDiskResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Compute.ManagedDiskData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Compute.ManagedDiskResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, diskName As String, data As ManagedDiskData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of ManagedDiskResource)

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.

diskName
String

The name of the managed disk that is being created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z, 0-9, _ and -. The maximum name length is 80 characters.

data
ManagedDiskData

Disk object supplied in the body of the Put disk operation.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

diskName or data is null.

Applies to