PageBlobClient.CreateIfNotExistsAsync Methode

Definition

Der CreateIfNotExistsAsync(Int64, PageBlobCreateOptions, CancellationToken) Vorgang erstellt ein neues Seitenblob des angegebenen size. Wenn das Blob bereits vorhanden ist, bleibt der Inhalt des vorhandenen Blobs unverändert. Wenn das Blob noch nicht vorhanden ist, wird ein neues Seitenblob mit dem angegebenen size erstellt. Azure.Storage.Blobs.Specialized.PageBlobClient.UploadPages(System.IO.Stream,System.Int64,System.Byte[],Azure.Storage.Blobs.Models.PageBlobRequestConditions,System.IProgress{System.Int64},System.Threading.CancellationToken) Vorgang.

Weitere Informationen finden Sie unter https://docs.microsoft.com/rest/api/storageservices/put-blob.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> CreateIfNotExistsAsync (long size, Azure.Storage.Blobs.Models.PageBlobCreateOptions options, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateIfNotExistsAsync : int64 * Azure.Storage.Blobs.Models.PageBlobCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>>
override this.CreateIfNotExistsAsync : int64 * Azure.Storage.Blobs.Models.PageBlobCreateOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>>
Public Overridable Function CreateIfNotExistsAsync (size As Long, options As PageBlobCreateOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of BlobContentInfo))

Parameter

size
Int64

Gibt die maximale Größe für das Seitenblob an, bis zu 8 TB. Die Größe muss an einer 512-Byte-Grenze ausgerichtet werden.

options
PageBlobCreateOptions

Optionale Parameter.

cancellationToken
CancellationToken

Optional CancellationToken zur Weitergabe von Benachrichtigungen, dass der Vorgang abgebrochen werden soll.

Gibt zurück

Wenn das Seitenblob noch nicht vorhanden ist, ein , Response<T> der das neu erstellte Seitenblob beschreibt. Andernfalls null.

Hinweise

Ein RequestFailedException wird ausgelöst, wenn ein Fehler auftritt.

Gilt für: