AppendBlobClient class
AppendBlobClient defines a set of operations applicable to append blobs.
- Extends
Constructors
Append |
Creates an instance of AppendBlobClient. 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. |
Append |
Creates an instance of AppendBlobClient. 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. |
Append |
Creates an instance of AppendBlobClient. |
Properties
account |
|
container |
The name of the storage container the blob is associated with. |
credential | Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the |
name | The name of the blob. |
url | Encoded URL string value. |
Methods
abort |
Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero length and full metadata. Version 2012-02-12 and newer. |
append |
Commits a new block of data to the end of the existing append blob. |
append |
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. |
begin |
Asynchronously copies a blob to a destination within the storage account.
This method returns a long running operation poller that allows you to wait
indefinitely until the copy is completed.
You can also cancel a copy before it is completed by calling |
create(Append |
Creates a 0-length append blob. Call AppendBlock to append data to an append blob. |
create |
Creates a 0-length append blob. Call AppendBlock to append data to an append blob. If the blob with the same name already exists, the content of the existing blob will remain unchanged. |
create |
Creates a read-only snapshot of a blob. |
delete(Blob |
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. |
delete |
Marks the specified blob or snapshot for deletion if it exists. 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. |
delete |
Delete the immutablility policy on the blob. |
download(number, number, Blob |
Reads or downloads a blob from the system, including its metadata and properties. You can also call Get Blob to read a snapshot.
|
download |
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob in parallel to a buffer. Offset and count are optional, downloads the entire blob if they are not provided. Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two gigabytes on 64-bit systems due to limitations of Node.js/V8. For blobs larger than this size, consider <xref:downloadToFile>. |
download |
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob in parallel to a buffer. Offset and count are optional, downloads the entire blob if they are not provided. Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two gigabytes on 64-bit systems due to limitations of Node.js/V8. For blobs larger than this size, consider <xref:downloadToFile>. |
download |
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob to a local file. Fails if the the given file path already exits. Offset and count are optional, pass 0 and undefined respectively to download the entire blob. |
exists(Blob |
Returns true if the Azure blob resource represented by this client exists; false otherwise. NOTE: use this function with care since an existing blob might be deleted by other clients or applications. Vice versa new blobs might be added by other clients or applications after this function completes. |
generate |
Only available for BlobClient constructed with a shared key credential. Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client. |
get |
Creates a AppendBlobClient object. |
get |
Get a <xref:BlobLeaseClient> that manages leases on the blob. |
get |
Creates a BlockBlobClient object. |
get |
Creates a PageBlobClient object. |
get |
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob. |
get |
Gets the tags associated with the underlying blob. |
seal(Append |
Seals the append blob, making it read only. |
set |
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. |
set |
Sets system properties on the blob. If no value provided, or no value provided for the specified blob HTTP headers, these blob HTTP headers without a value will be cleared. |
set |
Set immutablility policy on the blob. |
set |
Set legal hold on the blob. |
set |
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. |
set |
Sets tags on the underlying blob. A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. Valid tag key and value characters include lower and upper case letters, digits (0-9), space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_'). |
sync |
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. |
undelete(Blob |
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. |
with |
Creates a new AppendBlobClient object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a Client to the base blob. |
with |
Creates a new BlobClient object pointing to a version of this blob. Provide "" will remove the versionId and return a Client to the base blob. |
Constructor Details
AppendBlobClient(string, PipelineLike)
Creates an instance of AppendBlobClient. 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 AppendBlobClient(url: string, pipeline: PipelineLike)
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
- PipelineLike
Call newPipeline() to create a default pipeline, or provide a customized pipeline.
AppendBlobClient(string, StorageSharedKeyCredential | AnonymousCredential | TokenCredential, StoragePipelineOptions)
Creates an instance of AppendBlobClient. 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 AppendBlobClient(url: string, credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)
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".
- credential
-
StorageSharedKeyCredential | AnonymousCredential | TokenCredential
Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity
package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
- options
- StoragePipelineOptions
Optional. Options to configure the HTTP pipeline.
AppendBlobClient(string, string, string, StoragePipelineOptions)
Creates an instance of AppendBlobClient.
new AppendBlobClient(connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)
Parameters
- connectionString
-
string
Account connection string or a SAS connection string of an Azure storage account.
[ Note - Account connection string can only be used in NODE.JS runtime. ]
Account connection string example -
DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net
SAS connection string example -
BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString
- containerName
-
string
Container name.
- blobName
-
string
Blob name.
- options
- StoragePipelineOptions
Optional. Options to configure the HTTP pipeline.
Property Details
accountName
accountName: string
Property Value
string
containerName
The name of the storage container the blob is associated with.
string containerName
Property Value
string
credential
Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity
package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.
credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
Property Value
StorageSharedKeyCredential | AnonymousCredential | TokenCredential
name
The name of the blob.
string name
Property Value
string
url
Encoded URL string value.
url: string
Property Value
string
Method Details
abortCopyFromURL(string, BlobAbortCopyFromURLOptions)
Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero length and full metadata. Version 2012-02-12 and newer.
function abortCopyFromURL(copyId: string, options?: BlobAbortCopyFromURLOptions)
Parameters
- copyId
-
string
Id of the Copy From URL operation.
- options
- BlobAbortCopyFromURLOptions
Optional options to the Blob Abort Copy From URL operation.
Returns
Promise<BlobAbortCopyFromURLResponse>
appendBlock(HttpRequestBody, number, AppendBlobAppendBlockOptions)
Commits a new block of data to the end of the existing append blob.
function appendBlock(body: HttpRequestBody, contentLength: number, options?: AppendBlobAppendBlockOptions)
Parameters
- body
-
HttpRequestBody
Data to be appended.
- contentLength
-
number
Length of the body in bytes.
- options
- AppendBlobAppendBlockOptions
Options to the Append Block operation.
Example usage:
const content = "Hello World!";
// Create a new append blob and append data to the blob.
const newAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
await newAppendBlobClient.create();
await newAppendBlobClient.appendBlock(content, content.length);
// Append data to an existing append blob.
const existingAppendBlobClient = containerClient.getAppendBlobClient("<blob name>");
await existingAppendBlobClient.appendBlock(content, content.length);
Returns
Promise<AppendBlobAppendBlockResponse>
appendBlockFromURL(string, number, number, AppendBlobAppendBlockFromURLOptions)
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.
function appendBlockFromURL(sourceURL: string, sourceOffset: number, count: number, options?: AppendBlobAppendBlockFromURLOptions)
Parameters
- 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
Promise<AppendBlobAppendBlockFromUrlResponse>
beginCopyFromURL(string, BlobBeginCopyFromURLOptions)
Asynchronously copies a blob to a destination within the storage account.
This method returns a long running operation poller that allows you to wait
indefinitely until the copy is completed.
You can also cancel a copy before it is completed by calling cancelOperation
on the poller.
Note that the onProgress callback will not be invoked if the operation completes in the first
request, and attempting to cancel a completed copy will result in an error being thrown.
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.
function beginCopyFromURL(copySource: string, options?: BlobBeginCopyFromURLOptions)
Parameters
- copySource
-
string
url to the source Azure Blob/File.
- options
- BlobBeginCopyFromURLOptions
Optional options to the Blob Start Copy From URL operation.
Returns
Promise<PollerLike<PollOperationState<BlobBeginCopyFromURLResponse>, BlobBeginCopyFromURLResponse>>
create(AppendBlobCreateOptions)
Creates a 0-length append blob. Call AppendBlock to append data to an append blob.
function create(options?: AppendBlobCreateOptions)
Parameters
- options
- AppendBlobCreateOptions
Options to the Append Block Create operation.
Example usage:
const appendBlobClient = containerClient.getAppendBlobClient("<blob name>");
await appendBlobClient.create();
Returns
Promise<AppendBlobCreateResponse>
createIfNotExists(AppendBlobCreateIfNotExistsOptions)
Creates a 0-length append blob. Call AppendBlock to append data to an append blob. If the blob with the same name already exists, the content of the existing blob will remain unchanged.
function createIfNotExists(options?: AppendBlobCreateIfNotExistsOptions)
Parameters
Returns
Promise<AppendBlobCreateIfNotExistsResponse>
createSnapshot(BlobCreateSnapshotOptions)
Creates a read-only snapshot of a blob.
function createSnapshot(options?: BlobCreateSnapshotOptions)
Parameters
- options
- BlobCreateSnapshotOptions
Optional options to the Blob Create Snapshot operation.
Returns
Promise<BlobCreateSnapshotResponse>
delete(BlobDeleteOptions)
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.
function delete(options?: BlobDeleteOptions)
Parameters
- options
- BlobDeleteOptions
Optional options to Blob Delete operation.
Returns
Promise<BlobDeleteResponse>
deleteIfExists(BlobDeleteOptions)
Marks the specified blob or snapshot for deletion if it exists. 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.
function deleteIfExists(options?: BlobDeleteOptions)
Parameters
- options
- BlobDeleteOptions
Optional options to Blob Delete operation.
Returns
Promise<BlobDeleteIfExistsResponse>
deleteImmutabilityPolicy(BlobDeleteImmutabilityPolicyOptions)
Delete the immutablility policy on the blob.
function deleteImmutabilityPolicy(options?: BlobDeleteImmutabilityPolicyOptions)
Parameters
Optional options to delete immutability policy on the blob.
Returns
Promise<BlobDeleteImmutabilityPolicyResponse>
download(number, number, BlobDownloadOptions)
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
function download(offset?: number, count?: number, options?: BlobDownloadOptions)
Parameters
- offset
-
number
From which position of the blob to download, greater than or equal to 0
- count
-
number
How much data to be downloaded, greater than 0. Will download to the end when undefined
- options
- BlobDownloadOptions
Optional options to Blob Download operation.
Example usage (Node.js):
// Download and convert a blob to a string
const downloadBlockBlobResponse = await blobClient.download();
const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody);
console.log("Downloaded blob content:", downloaded.toString());
async function streamToBuffer(readableStream) {
return new Promise((resolve, reject) => {
const chunks = [];
readableStream.on("data", (data) => {
chunks.push(data instanceof Buffer ? data : Buffer.from(data));
});
readableStream.on("end", () => {
resolve(Buffer.concat(chunks));
});
readableStream.on("error", reject);
});
}
Example usage (browser):
// Download and convert a blob to a string
const downloadBlockBlobResponse = await blobClient.download();
const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody);
console.log(
"Downloaded blob content",
downloaded
);
async function blobToString(blob: Blob): Promise<string> {
const fileReader = new FileReader();
return new Promise<string>((resolve, reject) => {
fileReader.onloadend = (ev: any) => {
resolve(ev.target!.result);
};
fileReader.onerror = reject;
fileReader.readAsText(blob);
});
}
Returns
Promise<BlobDownloadResponseParsed>
downloadToBuffer(Buffer, number, number, BlobDownloadToBufferOptions)
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob in parallel to a buffer. Offset and count are optional, downloads the entire blob if they are not provided.
Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two gigabytes on 64-bit systems due to limitations of Node.js/V8. For blobs larger than this size, consider <xref:downloadToFile>.
function downloadToBuffer(buffer: Buffer, offset?: number, count?: number, options?: BlobDownloadToBufferOptions)
Parameters
- buffer
-
Buffer
Buffer to be fill, must have length larger than count
- offset
-
number
From which position of the block blob to download(in bytes)
- count
-
number
How much data(in bytes) to be downloaded. Will download to the end when passing undefined
- options
- BlobDownloadToBufferOptions
BlobDownloadToBufferOptions
Returns
Promise<Buffer>
downloadToBuffer(number, number, BlobDownloadToBufferOptions)
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob in parallel to a buffer. Offset and count are optional, downloads the entire blob if they are not provided.
Warning: Buffers can only support files up to about one gigabyte on 32-bit systems or about two gigabytes on 64-bit systems due to limitations of Node.js/V8. For blobs larger than this size, consider <xref:downloadToFile>.
function downloadToBuffer(offset?: number, count?: number, options?: BlobDownloadToBufferOptions)
Parameters
- offset
-
number
From which position of the block blob to download(in bytes)
- count
-
number
How much data(in bytes) to be downloaded. Will download to the end when passing undefined
- options
- BlobDownloadToBufferOptions
BlobDownloadToBufferOptions
Returns
Promise<Buffer>
downloadToFile(string, number, number, BlobDownloadOptions)
ONLY AVAILABLE IN NODE.JS RUNTIME. Downloads an Azure Blob to a local file. Fails if the the given file path already exits. Offset and count are optional, pass 0 and undefined respectively to download the entire blob.
function downloadToFile(filePath: string, offset?: number, count?: number, options?: BlobDownloadOptions)
Parameters
- filePath
-
string
- offset
-
number
From which position of the block blob to download.
- count
-
number
How much data to be downloaded. Will download to the end when passing undefined.
- options
- BlobDownloadOptions
Options to Blob download options.
Returns
Promise<BlobDownloadResponseParsed>
The response data for blob download operation, but with readableStreamBody set to undefined since its content is already read and written into a local file at the specified path.
exists(BlobExistsOptions)
Returns true if the Azure blob resource represented by this client exists; false otherwise. NOTE: use this function with care since an existing blob might be deleted by other clients or applications. Vice versa new blobs might be added by other clients or applications after this function completes.
function exists(options?: BlobExistsOptions)
Parameters
- options
- BlobExistsOptions
options to Exists operation.
Returns
Promise<boolean>
generateSasUrl(BlobGenerateSasUrlOptions)
Only available for BlobClient constructed with a shared key credential. Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties and parameters passed in. The SAS is signed by the shared key credential of the client.
function generateSasUrl(options: BlobGenerateSasUrlOptions)
Parameters
- options
- BlobGenerateSasUrlOptions
Optional parameters.
Returns
Promise<string>
The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.
getAppendBlobClient()
getBlobLeaseClient(string)
Get a <xref:BlobLeaseClient> that manages leases on the blob.
function getBlobLeaseClient(proposeLeaseId?: string)
Parameters
- proposeLeaseId
-
string
Initial proposed lease Id.
Returns
A new BlobLeaseClient object for managing leases on the blob.
getBlockBlobClient()
getPageBlobClient()
getProperties(BlobGetPropertiesOptions)
Returns all user-defined metadata, standard HTTP properties, and system properties for the blob. It does not return the content of the blob.
function getProperties(options?: BlobGetPropertiesOptions)
Parameters
- options
- BlobGetPropertiesOptions
Optional options to Get Properties operation.
Returns
Promise<BlobGetPropertiesResponse>
getTags(BlobGetTagsOptions)
Gets the tags associated with the underlying blob.
function getTags(options?: BlobGetTagsOptions)
Parameters
- options
- BlobGetTagsOptions
Returns
Promise<BlobGetTagsResponse>
seal(AppendBlobSealOptions)
Seals the append blob, making it read only.
function seal(options?: AppendBlobSealOptions)
Parameters
- options
- AppendBlobSealOptions
Returns
Promise<AppendBlobAppendBlockResponse>
setAccessTier(BlockBlobTier | PremiumPageBlobTier | string, BlobSetTierOptions)
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.
function setAccessTier(tier: BlockBlobTier | PremiumPageBlobTier | string, options?: BlobSetTierOptions)
Parameters
- tier
-
BlockBlobTier | PremiumPageBlobTier | string
The tier to be set on the blob. Valid values are Hot, Cool, or Archive.
- options
- BlobSetTierOptions
Optional options to the Blob Set Tier operation.
Returns
Promise<BlobSetTierResponse>
setHTTPHeaders(BlobHTTPHeaders, BlobSetHTTPHeadersOptions)
Sets system properties on the blob. If no value provided, or no value provided for the specified blob HTTP headers, these blob HTTP headers without a value will be cleared.
function setHTTPHeaders(blobHTTPHeaders?: BlobHTTPHeaders, options?: BlobSetHTTPHeadersOptions)
Parameters
- blobHTTPHeaders
- BlobHTTPHeaders
If no value provided, or no value provided for
the specified blob HTTP headers, these blob HTTP
headers without a value will be cleared.
A common header to set is blobContentType
enabling the browser to provide functionality
based on file type.
- options
- BlobSetHTTPHeadersOptions
Optional options to Blob Set HTTP Headers operation.
Returns
Promise<BlobSetHTTPHeadersResponse>
setImmutabilityPolicy(BlobImmutabilityPolicy, BlobSetImmutabilityPolicyOptions)
Set immutablility policy on the blob.
function setImmutabilityPolicy(immutabilityPolicy: BlobImmutabilityPolicy, options?: BlobSetImmutabilityPolicyOptions)
Parameters
- immutabilityPolicy
- BlobImmutabilityPolicy
- options
- BlobSetImmutabilityPolicyOptions
Optional options to set immutability policy on the blob.
Returns
Promise<BlobSetImmutabilityPolicyResponse>
setLegalHold(boolean, BlobSetLegalHoldOptions)
Set legal hold on the blob.
function setLegalHold(legalHoldEnabled: boolean, options?: BlobSetLegalHoldOptions)
Parameters
- legalHoldEnabled
-
boolean
- options
- BlobSetLegalHoldOptions
Optional options to set legal hold on the blob.
Returns
Promise<BlobSetLegalHoldResponse>
setMetadata(Metadata, BlobSetMetadataOptions)
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.
function setMetadata(metadata?: Metadata, options?: BlobSetMetadataOptions)
Parameters
- metadata
- Metadata
Replace existing metadata with this value. If no value provided the existing metadata will be removed.
- options
- BlobSetMetadataOptions
Optional options to Set Metadata operation.
Returns
Promise<BlobSetMetadataResponse>
setTags(Tags, BlobSetTagsOptions)
Sets tags on the underlying blob. A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters. Valid tag key and value characters include lower and upper case letters, digits (0-9), space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_').
function setTags(tags: Tags, options?: BlobSetTagsOptions)
Parameters
- tags
- Tags
- options
- BlobSetTagsOptions
Returns
Promise<BlobSetTagsResponse>
syncCopyFromURL(string, BlobSyncCopyFromURLOptions)
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.
function syncCopyFromURL(copySource: string, options?: BlobSyncCopyFromURLOptions)
Parameters
- copySource
-
string
The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication
- options
- BlobSyncCopyFromURLOptions
Returns
Promise<BlobCopyFromURLResponse>
undelete(BlobUndeleteOptions)
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.
function undelete(options?: BlobUndeleteOptions)
Parameters
- options
- BlobUndeleteOptions
Optional options to Blob Undelete operation.
Returns
Promise<BlobUndeleteResponse>
withSnapshot(string)
Creates a new AppendBlobClient object identical to the source but with the specified snapshot timestamp. Provide "" will remove the snapshot and return a Client to the base blob.
function withSnapshot(snapshot: string)
Parameters
- snapshot
-
string
The snapshot timestamp.
Returns
A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.
withVersion(string)
Creates a new BlobClient object pointing to a version of this blob. Provide "" will remove the versionId and return a Client to the base blob.
function withVersion(versionId: string)
Parameters
- versionId
-
string
The versionId.
Returns
A new BlobClient object pointing to the version of this blob.
Azure SDK for JavaScript