StorageDataShareCollection.CreateOrUpdate Method

Definition

Create a Storage DataShare if it does not already exist; otherwise, error out. This API will not allow you to replace an already existing resource.

  • Request Path. : /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/dataShares/{dataShareName}.
  • Operation Id. : DataShares_Create.
  • Default Api Version. : 2025-08-01.
public virtual Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageDataShareResource> CreateOrUpdate(Azure.WaitUntil waitUntil, string dataShareName, Azure.ResourceManager.Storage.StorageDataShareData data, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Storage.StorageDataShareData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageDataShareResource>
override this.CreateOrUpdate : Azure.WaitUntil * string * Azure.ResourceManager.Storage.StorageDataShareData * System.Threading.CancellationToken -> Azure.ResourceManager.ArmOperation<Azure.ResourceManager.Storage.StorageDataShareResource>
Public Overridable Function CreateOrUpdate (waitUntil As WaitUntil, dataShareName As String, data As StorageDataShareData, Optional cancellationToken As CancellationToken = Nothing) As ArmOperation(Of StorageDataShareResource)

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.

dataShareName
String

The name of the Storage DataShare.

data
StorageDataShareData

Create a Storage DataShare if it does not already exist; otherwise, error out. This API will not allow you to replace an already existing resource.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

dataShareName or data is null.

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

Applies to