StorageAccountCollection.CreateOrUpdate Method

Definition

Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.

  • Request Path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}
  • Operation Id: StorageAccounts_Create
  • Default Api Version: 2023-05-01
  • Resource: StorageAccountResource
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageAccountResource> CreateOrUpdate (Azure.WaitUntil waitUntil, string accountName, Azure.ResourceManager.Storage.Models.StorageAccountCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Storage.Models.StorageAccountCreateOrUpdateContent * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageAccountResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Storage.Models.StorageAccountCreateOrUpdateContent * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageAccountResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, accountName As String, content As StorageAccountCreateOrUpdateContent, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of StorageAccountResource)

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.

accountName
String

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

content
StorageAccountCreateOrUpdateContent

The parameters to provide for the created account.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

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

accountName or content is null.

Applies to