AppendBlobURL class

AppendBlobURL defines a set of operations applicable to append blobs.

Extends

Constructors

AppendBlobURL(string, Pipeline)

Creates an instance of AppendBlobURL. This method accepts an encoded URL or non-encoded URL pointing to an append blob. Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. If a blob name includes ? or %, blob name must be encoded in the URL.

Inherited Properties

credential

Credential used for authentication and authorization.

url

Encoded URL string value.

Methods

appendBlock(Aborter, HttpRequestBody, number, IAppendBlobAppendBlockOptions)

Commits a new block of data to the end of the existing append blob.

See https://docs.microsoft.com/rest/api/storageservices/append-block

appendBlockFromURL(Aborter, string, number, number, IAppendBlobAppendBlockFromURLOptions)

The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url.

See https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url

create(Aborter, IAppendBlobCreateOptions)

Creates a 0-length append blob. Call AppendBlock to append data to an append blob.

See https://docs.microsoft.com/rest/api/storageservices/put-blob

fromBlobURL(BlobURL)

Creates a AppendBlobURL object from BlobURL instance.

fromContainerURL(ContainerURL, string)

Creates a AppendBlobURL object from ContainerURL instance.

withPipeline(Pipeline)

Creates a new AppendBlobURL object identical to the source but with the specified request policy pipeline.

withSnapshot(string)

Creates a new AppendBlobURL object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a URL to the base blob.

Inherited Methods

abortCopyFromURL(Aborter, string, IBlobAbortCopyFromURLOptions)

Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero length and full metadata. Version 2012-02-12 and newer.

See https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob

acquireLease(Aborter, string, number, IBlobAcquireLeaseOptions)

Establishes and manages a lock on a blob for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. In versions prior to 2012-02-12, the lock duration is 60 seconds.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

breakLease(Aborter, number, IBlobBreakLeaseOptions)

To end the lease but ensure that another client cannot acquire a new lease until the current lease period has expired.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

changeLease(Aborter, string, string, IBlobChangeLeaseOptions)

To change the ID of an existing lease.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

createSnapshot(Aborter, IBlobCreateSnapshotOptions)

Creates a read-only snapshot of a blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob

delete(Aborter, IBlobDeleteOptions)

Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection. Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time with the Delete Blob operation.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob

download(Aborter, number, number, IBlobDownloadOptions)

Reads or downloads a blob from the system, including its metadata and properties. You can also call Get Blob to read a snapshot.

  • In Node.js, data returns in a Readable stream readableStreamBody
  • In browsers, data returns in a promise blobBody

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob

getProperties(Aborter, IBlobGetPropertiesOptions)

Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

releaseLease(Aborter, string, IBlobReleaseLeaseOptions)

To free the lease if it is no longer needed so that another client may immediately acquire a lease against the blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

renewLease(Aborter, string, IBlobRenewLeaseOptions)

To renew an existing lease.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

setHTTPHeaders(Aborter, BlobHTTPHeaders, IBlobSetHTTPHeadersOptions)

Sets system properties on the blob.

If no value provided, or no value provided for the specificed blob HTTP headers, these blob HTTP headers without a value will be cleared.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties

setMetadata(Aborter, IMetadata, IBlobSetMetadataOptions)

Sets user-defined metadata for the specified blob as one or more name-value pairs.

If no option provided, or no metadata defined in the parameter, the blob metadata will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata

setTier(Aborter, string, IBlobSetTierOptions)

Sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier

startCopyFromURL(Aborter, string, IBlobStartCopyFromURLOptions)

Asynchronously copies a blob to a destination within the storage account. In version 2012-02-12 and later, the source for a Copy Blob operation can be a committed blob in any Azure storage account. Beginning with version 2015-02-21, the source for a Copy Blob operation can be an Azure file in any Azure storage account. Only storage accounts created on or after June 7th, 2012 allow the Copy Blob operation to copy from another storage account.

See https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob

syncCopyFromURL(Aborter, string, IBlobSyncCopyFromURLOptions)

The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.

See https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url

undelete(Aborter)

Restores the contents and metadata of soft deleted blob and any associated soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 or later.

See https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob

Constructor Details

AppendBlobURL(string, Pipeline)

Creates an instance of AppendBlobURL. This method accepts an encoded URL or non-encoded URL pointing to an append blob. Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. If a blob name includes ? or %, blob name must be encoded in the URL.

new AppendBlobURL(url: string, pipeline: Pipeline)

Parameters

url

string

A URL string pointing to Azure Storage append blob, such as "https://myaccount.blob.core.windows.net/mycontainer/appendblob". You can append a SAS if using AnonymousCredential, such as "https://myaccount.blob.core.windows.net/mycontainer/appendblob?sasString". This method accepts an encoded URL or non-encoded URL pointing to a blob. Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. However, if a blob name includes ? or %, blob name must be encoded in the URL. Such as a blob named "my?blob%", the URL should be "https://myaccount.blob.core.windows.net/mycontainer/my%3Fblob%25".

pipeline
Pipeline

Call StorageURL.newPipeline() to create a default pipeline, or provide a customized pipeline.

Inherited Property Details

credential

Credential used for authentication and authorization.

credential: Credential

Property Value

Inherited From BlobURL.credential

url

Encoded URL string value.

url: string

Property Value

string

Inherited From BlobURL.url

Method Details

appendBlock(Aborter, HttpRequestBody, number, IAppendBlobAppendBlockOptions)

Commits a new block of data to the end of the existing append blob.

See https://docs.microsoft.com/rest/api/storageservices/append-block

function appendBlock(aborter: Aborter, body: HttpRequestBody, contentLength: number, options?: IAppendBlobAppendBlockOptions): Promise<AppendBlobAppendBlockResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

contentLength

number

Length of the body in bytes

Returns

appendBlockFromURL(Aborter, string, number, number, IAppendBlobAppendBlockFromURLOptions)

The Append Block operation commits a new block of data to the end of an existing append blob where the contents are read from a source url.

See https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url

function appendBlockFromURL(aborter: Aborter, sourceURL: string, sourceOffset: number, count: number, options?: IAppendBlobAppendBlockFromURLOptions): Promise<AppendBlobAppendBlockFromUrlResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

sourceURL

string

The url to the blob that will be the source of the copy. A source blob in the same storage account can be authenticated via Shared Key. However, if the source is a blob in another account, the source blob must either be public or must be authenticated via a shared access signature. If the source blob is public, no authentication is required to perform the operation.

sourceOffset

number

Offset in source to be appended

count

number

Number of bytes to be appended as a block

Returns

create(Aborter, IAppendBlobCreateOptions)

Creates a 0-length append blob. Call AppendBlock to append data to an append blob.

See https://docs.microsoft.com/rest/api/storageservices/put-blob

function create(aborter: Aborter, options?: IAppendBlobCreateOptions): Promise<AppendBlobCreateResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

fromBlobURL(BlobURL)

Creates a AppendBlobURL object from BlobURL instance.

static function fromBlobURL(blobURL: BlobURL): AppendBlobURL

Parameters

blobURL
BlobURL

Returns

fromContainerURL(ContainerURL, string)

Creates a AppendBlobURL object from ContainerURL instance.

static function fromContainerURL(containerURL: ContainerURL, blobName: string): AppendBlobURL

Parameters

containerURL
ContainerURL

A ContainerURL object

blobName

string

An append blob name

Returns

withPipeline(Pipeline)

Creates a new AppendBlobURL object identical to the source but with the specified request policy pipeline.

function withPipeline(pipeline: Pipeline): AppendBlobURL

Parameters

pipeline
Pipeline

Returns

withSnapshot(string)

Creates a new AppendBlobURL object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a URL to the base blob.

function withSnapshot(snapshot: string): AppendBlobURL

Parameters

snapshot

string

Returns

Inherited Method Details

abortCopyFromURL(Aborter, string, IBlobAbortCopyFromURLOptions)

Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero length and full metadata. Version 2012-02-12 and newer.

See https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob

function abortCopyFromURL(aborter: Aborter, copyId: string, options?: IBlobAbortCopyFromURLOptions): Promise<BlobAbortCopyFromURLResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

copyId

string

Returns

Inherited From BlobURL.abortCopyFromURL

acquireLease(Aborter, string, number, IBlobAcquireLeaseOptions)

Establishes and manages a lock on a blob for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite. In versions prior to 2012-02-12, the lock duration is 60 seconds.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

function acquireLease(aborter: Aborter, proposedLeaseId: string, duration: number, options?: IBlobAcquireLeaseOptions): Promise<BlobAcquireLeaseResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

proposedLeaseId

string

Can be specified in any valid GUID string format

duration

number

The lock duration can be 15 to 60 seconds, or can be infinite

Returns

Inherited From BlobURL.acquireLease

breakLease(Aborter, number, IBlobBreakLeaseOptions)

To end the lease but ensure that another client cannot acquire a new lease until the current lease period has expired.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

function breakLease(aborter: Aborter, breakPeriod?: number, options?: IBlobBreakLeaseOptions): Promise<BlobBreakLeaseResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

breakPeriod

number

Returns

Inherited From BlobURL.breakLease

changeLease(Aborter, string, string, IBlobChangeLeaseOptions)

To change the ID of an existing lease.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

function changeLease(aborter: Aborter, leaseId: string, proposedLeaseId: string, options?: IBlobChangeLeaseOptions): Promise<BlobChangeLeaseResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

leaseId

string

proposedLeaseId

string

Returns

Inherited From BlobURL.changeLease

createSnapshot(Aborter, IBlobCreateSnapshotOptions)

Creates a read-only snapshot of a blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob

function createSnapshot(aborter: Aborter, options?: IBlobCreateSnapshotOptions): Promise<BlobCreateSnapshotResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

Inherited From BlobURL.createSnapshot

delete(Aborter, IBlobDeleteOptions)

Marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection. Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time with the Delete Blob operation.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob

function delete(aborter: Aborter, options?: IBlobDeleteOptions): Promise<BlobDeleteResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

Inherited From BlobURL.delete

download(Aborter, number, number, IBlobDownloadOptions)

Reads or downloads a blob from the system, including its metadata and properties. You can also call Get Blob to read a snapshot.

  • In Node.js, data returns in a Readable stream readableStreamBody
  • In browsers, data returns in a promise blobBody

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob

function download(aborter: Aborter, offset: number, count?: number, options?: IBlobDownloadOptions): Promise<BlobDownloadResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

offset

number

From which position of the blob to download, >= 0

count

number

How much data to be downloaded, > 0. Will download to the end when undefined

Returns

Inherited From BlobURL.download

getProperties(Aborter, IBlobGetPropertiesOptions)

Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties

function getProperties(aborter: Aborter, options?: IBlobGetPropertiesOptions): Promise<BlobGetPropertiesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

Inherited From BlobURL.getProperties

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

static function newPipeline(credential: Credential, pipelineOptions?: INewPipelineOptions): Pipeline

Parameters

credential
Credential

Such as AnonymousCredential, SharedKeyCredential or TokenCredential.

pipelineOptions
INewPipelineOptions

Optional. Options.

Returns

A new Pipeline object.

Inherited From BlobURL.newPipeline

releaseLease(Aborter, string, IBlobReleaseLeaseOptions)

To free the lease if it is no longer needed so that another client may immediately acquire a lease against the blob.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

function releaseLease(aborter: Aborter, leaseId: string, options?: IBlobReleaseLeaseOptions): Promise<BlobReleaseLeaseResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

leaseId

string

Returns

Inherited From BlobURL.releaseLease

renewLease(Aborter, string, IBlobRenewLeaseOptions)

To renew an existing lease.

See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob

function renewLease(aborter: Aborter, leaseId: string, options?: IBlobRenewLeaseOptions): Promise<BlobRenewLeaseResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

leaseId

string

Returns

Inherited From BlobURL.renewLease

setHTTPHeaders(Aborter, BlobHTTPHeaders, IBlobSetHTTPHeadersOptions)

Sets system properties on the blob.

If no value provided, or no value provided for the specificed blob HTTP headers, these blob HTTP headers without a value will be cleared.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties

function setHTTPHeaders(aborter: Aborter, blobHTTPHeaders?: BlobHTTPHeaders, options?: IBlobSetHTTPHeadersOptions): Promise<BlobSetHTTPHeadersResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

blobHTTPHeaders
BlobHTTPHeaders

If no value provided, or no value provided for the specificed blob HTTP headers, these blob HTTP headers without a value will be cleared.

Returns

Inherited From BlobURL.setHTTPHeaders

setMetadata(Aborter, IMetadata, IBlobSetMetadataOptions)

Sets user-defined metadata for the specified blob as one or more name-value pairs.

If no option provided, or no metadata defined in the parameter, the blob metadata will be removed.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata

function setMetadata(aborter: Aborter, metadata?: IMetadata, options?: IBlobSetMetadataOptions): Promise<BlobSetMetadataResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

metadata

IMetadata

Replace existing metadata with this value. If no value provided the existing metadata will be removed.

Returns

Inherited From BlobURL.setMetadata

setTier(Aborter, string, IBlobSetTierOptions)

Sets the tier on a blob. The operation is allowed on a page blob in a premium storage account and on a block blob in a blob storage account (locally redundant storage only). A premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's ETag.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier

function setTier(aborter: Aborter, tier: string, options?: IBlobSetTierOptions): Promise<BlobSetTierResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

tier

string

Returns

Inherited From BlobURL.setTier

startCopyFromURL(Aborter, string, IBlobStartCopyFromURLOptions)

Asynchronously copies a blob to a destination within the storage account. In version 2012-02-12 and later, the source for a Copy Blob operation can be a committed blob in any Azure storage account. Beginning with version 2015-02-21, the source for a Copy Blob operation can be an Azure file in any Azure storage account. Only storage accounts created on or after June 7th, 2012 allow the Copy Blob operation to copy from another storage account.

See https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob

function startCopyFromURL(aborter: Aborter, copySource: string, options?: IBlobStartCopyFromURLOptions): Promise<BlobStartCopyFromURLResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

copySource

string

Returns

Inherited From BlobURL.startCopyFromURL

syncCopyFromURL(Aborter, string, IBlobSyncCopyFromURLOptions)

The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not return a response until the copy is complete.

See https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url

function syncCopyFromURL(aborter: Aborter, copySource: string, options?: IBlobSyncCopyFromURLOptions): Promise<BlobCopyFromURLResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

copySource

string

The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication

Returns

Inherited From BlobURL.syncCopyFromURL

undelete(Aborter)

Restores the contents and metadata of soft deleted blob and any associated soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29 or later.

See https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob

function undelete(aborter: Aborter): Promise<BlobUndeleteResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

Inherited From BlobURL.undelete