Defines values for AccountKind. Possible values include: 'Storage', 'BlobStorage', 'StorageV2'
Contains response data for the appendBlockFromUrl operation.
Contains response data for the appendBlock operation.
Contains response data for the create operation.
Defines values for ArchiveStatus. Possible values include: 'rehydrate-pending-to-hot', 'rehydrate-pending-to-cool'
Contains response data for the abortCopyFromURL operation.
Contains response data for the acquireLease operation.
Contains response data for the deleteBlobs operation.
Contains response data for the setBlobsAccessTier operation.
Contains response data for blob batch operations.
Contains response data for the breakLease operation.
Contains response data for the changeLease operation.
Contains response data for the copyFromURL operation.
Contains response data for the createSnapshot operation.
Contains response data for the deleteMethod operation.
Contains response data for the getAccessControl operation.
Contains response data for the getAccountInfo operation.
Contains response data for the getProperties operation.
Contains response data for the releaseLease operation.
Contains response data for the rename operation.
Contains response data for the renewLease operation.
Contains response data for the setAccessControl operation.
Contains response data for the setHTTPHeaders operation.
Contains response data for the setMetadata operation.
Contains response data for the setTier operation.
Contains response data for the startCopyFromURL operation.
Defines values for BlobType. Possible values include: 'BlockBlob', 'PageBlob', 'AppendBlob'
Contains response data for the undelete operation.
Response type for BlockBlobClient.uploadFile, BlockBlobClient.uploadStream, and {@link BlockBlobClient.uploadBrowserDate}.
Contains response data for the commitBlockList operation.
Contains response data for the getBlockList operation.
Contains response data for the stageBlockFromURL operation.
Contains response data for the stageBlock operation.
Contains response data for the upload operation.
Defines values for BlockListType. Possible values include: 'committed', 'uncommitted', 'all'
Contains response data for the acquireLease operation.
Contains response data for the breakLease operation.
Contains response data for the changeLease operation.
Contains response data for the create operation.
Contains response data for the deleteMethod operation.
Contains response data for the getAccessPolicy operation. Contains response data for the ContainerClient.getAccessPolicy operation.
Contains response data for the getAccountInfo operation.
Contains response data for the getProperties operation.
Contains response data for the listBlobFlatSegment operation.
Contains response data for the listBlobHierarchySegment operation.
Contains response data for the releaseLease operation.
Contains response data for the renewLease operation.
Contains response data for the setAccessPolicy operation.
Contains response data for the setMetadata operation.
Defines the operations from a BlobClient that are needed for the poller returned by BlobClient.beginCopyFromURL to work.
Defines values for CopyStatusType. Possible values include: 'pending', 'success', 'aborted', 'failed'
A factory function that creates a new CredentialPolicy that uses the provided nextPolicy.
Defines values for DeleteSnapshotsOptionType. Possible values include: 'include', 'only'
Contains response data for the create operation.
Contains response data for the deleteMethod operation.
Contains response data for the getAccessControl operation.
Contains response data for the rename operation.
Contains response data for the setAccessControl operation.
Defines values for EncryptionAlgorithmType. Possible values include: 'AES256'
Defines values for GeoReplicationStatusType. Possible values include: 'live', 'bootstrap', 'unavailable'
Defines values for LeaseDurationType. Possible values include: 'infinite', 'fixed'
Contains the response data for operations that create, modify, or delete a lease.
See BlobLeaseClient.
Defines values for LeaseStateType. Possible values include: 'available', 'leased', 'expired', 'breaking', 'broken'
Defines values for LeaseStatusType. Possible values include: 'locked', 'unlocked'
Defines values for ListBlobsIncludeItem. Possible values include: 'copy', 'deleted', 'metadata', 'snapshots', 'uncommittedblobs'
Defines values for ListContainersIncludeType. Possible values include: 'metadata'
Operation is an async function to be executed and managed by Batch.
OutgoingHandler is an async function triggered by BufferScheduler.
Contains response data for the clearPages operation.
Contains response data for the copyIncremental operation.
Contains response data for the create operation.
Contains response data for the getPageRangesDiff operation. Contains response data for the {@link BlobClient.getPageRangesDiff} operation.
The underlying HTTP response.
The size of the blob in bytes.
Present if the prevSnapshot parameter was specified and there were cleared pages between the previous snapshot and the target snapshot.
If a client request id header is sent in the request, this header will be present in the response with the same value.
UTC date/time value generated by the service that indicates the time at which the response was initiated
The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes.
Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob.
Valid non-overlapping page ranges.
This header uniquely identifies the request that was made and can be used for troubleshooting the request.
Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above.
Contains response data for the getPageRanges operation. Contains response data for the {@link BlobClient.getPageRanges} operation.
The underlying HTTP response.
The size of the blob in bytes.
Present if the prevSnapshot parameter was specified and there were cleared pages between the previous snapshot and the target snapshot.
If a client request id header is sent in the request, this header will be present in the response with the same value.
UTC date/time value generated by the service that indicates the time at which the response was initiated
The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes.
Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob.
Valid non-overlapping page ranges.
This header uniquely identifies the request that was made and can be used for troubleshooting the request.
Indicates the version of the Blob service used to execute the request. This header is returned for requests made against version 2009-09-19 and above.
Contains response data for the resize operation.
Contains response data for the updateSequenceNumber operation.
Contains response data for the uploadPagesFromURL operation.
Contains response data for the uploadPages operation.
Defines values for PathRenameMode. Possible values include: 'legacy', 'posix'
Defines values for PublicAccessType. Possible values include: 'container', 'blob'
Defines values for RehydratePriority. Possible values include: 'High', 'Standard'
Defines values for SequenceNumberActionType. Possible values include: 'max', 'update', 'increment'
Contains response data for the getAccountInfo operation.
Contains response data for the getProperties operation.
Contains response data for the getStatistics operation.
Contains response data for the getUserDelegationKey operation. Contains response data for the getUserDelegationKey operation.
Contains response data for the listContainersSegment operation.
Contains response data for the setProperties operation.
Contains response data for the submitBatch operation.
Defines values for SkuName. Possible values include: 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS'
Defines values for StorageErrorCode. Possible values include: 'AccountAlreadyExists', 'AccountBeingCreated', 'AccountIsDisabled', 'AuthenticationFailed', 'AuthorizationFailure', 'ConditionHeadersNotSupported', 'ConditionNotMet', 'EmptyMetadataKey', 'InsufficientAccountPermissions', 'InternalError', 'InvalidAuthenticationInfo', 'InvalidHeaderValue', 'InvalidHttpVerb', 'InvalidInput', 'InvalidMd5', 'InvalidMetadata', 'InvalidQueryParameterValue', 'InvalidRange', 'InvalidResourceName', 'InvalidUri', 'InvalidXmlDocument', 'InvalidXmlNodeValue', 'Md5Mismatch', 'MetadataTooLarge', 'MissingContentLengthHeader', 'MissingRequiredQueryParameter', 'MissingRequiredHeader', 'MissingRequiredXmlNode', 'MultipleConditionHeadersNotSupported', 'OperationTimedOut', 'OutOfRangeInput', 'OutOfRangeQueryParameterValue', 'RequestBodyTooLarge', 'ResourceTypeMismatch', 'RequestUrlFailedToParse', 'ResourceAlreadyExists', 'ResourceNotFound', 'ServerBusy', 'UnsupportedHeader', 'UnsupportedXmlNode', 'UnsupportedQueryParameter', 'UnsupportedHttpVerb', 'AppendPositionConditionNotMet', 'BlobAlreadyExists', 'BlobNotFound', 'BlobOverwritten', 'BlobTierInadequateForContentLength', 'BlockCountExceedsLimit', 'BlockListTooLong', 'CannotChangeToLowerTier', 'CannotVerifyCopySource', 'ContainerAlreadyExists', 'ContainerBeingDeleted', 'ContainerDisabled', 'ContainerNotFound', 'ContentLengthLargerThanTierLimit', 'CopyAcrossAccountsNotSupported', 'CopyIdMismatch', 'FeatureVersionMismatch', 'IncrementalCopyBlobMismatch', 'IncrementalCopyOfEralierVersionSnapshotNotAllowed', 'IncrementalCopySourceMustBeSnapshot', 'InfiniteLeaseDurationRequired', 'InvalidBlobOrBlock', 'InvalidBlobTier', 'InvalidBlobType', 'InvalidBlockId', 'InvalidBlockList', 'InvalidOperation', 'InvalidPageRange', 'InvalidSourceBlobType', 'InvalidSourceBlobUrl', 'InvalidVersionForPageBlobOperation', 'LeaseAlreadyPresent', 'LeaseAlreadyBroken', 'LeaseIdMismatchWithBlobOperation', 'LeaseIdMismatchWithContainerOperation', 'LeaseIdMismatchWithLeaseOperation', 'LeaseIdMissing', 'LeaseIsBreakingAndCannotBeAcquired', 'LeaseIsBreakingAndCannotBeChanged', 'LeaseIsBrokenAndCannotBeRenewed', 'LeaseLost', 'LeaseNotPresentWithBlobOperation', 'LeaseNotPresentWithContainerOperation', 'LeaseNotPresentWithLeaseOperation', 'MaxBlobSizeConditionNotMet', 'NoAuthenticationInformation', 'NoPendingCopyOperation', 'OperationNotAllowedOnIncrementalCopyBlob', 'PendingCopyOperation', 'PreviousSnapshotCannotBeNewer', 'PreviousSnapshotNotFound', 'PreviousSnapshotOperationNotSupported', 'SequenceNumberConditionNotMet', 'SequenceNumberIncrementTooLarge', 'SnapshotCountExceeded', 'SnaphotOperationRateExceeded', 'SnapshotsPresent', 'SourceConditionNotMet', 'SystemInUse', 'TargetConditionNotMet', 'UnauthorizedBlobOverwrite', 'BlobBeingRehydrated', 'BlobArchived', 'BlobNotArchived', 'AuthorizationSourceIPMismatch', 'AuthorizationProtocolMismatch', 'AuthorizationPermissionMismatch', 'AuthorizationServiceMismatch', 'AuthorizationResourceTypeMismatch'
Defines values for SyncCopyStatusType. Possible values include: 'success'
The OAuth scope to use with Azure Storage.
The @azure/logger configuration for this package.
A factory method used to generated a RetryPolicy factory.
Append a string to URL path. Will remove duplicated "/" in front of the string when URL path ends with a "/".
Source URL string
String to be appended to URL
An updated URL string
Base64 decode.
Base64 encode.
Convert a Browser Blob object into ArrayBuffer.
Convert a Browser Blob object into string.
Creates a span using the global tracer.
The options for the underlying http request.
Delay specified time interval.
Internal escape method implmented Strategy Two mentioned in escapeURL() description.
Reserved URL characters must be properly escaped for Storage services like Blob or File.
When customers pass a URL string into XxxClient classes constrcutor, the URL string may already be URL encoded or not. But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors.
This is what legacy V2 SDK does, simple and works for most of the cases.
But this strategy will make it not possible to create a blob with "?" in it's name. Because when customer URL string is "http://account.blob.core.windows.net/con/blob?name", the "?name" will be treated as URL paramter instead of blob name. If customer URL string is "http://account.blob.core.windows.net/con/blob%3Fname", a blob named "blob%3Fname" will be created. V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it. We cannot accept a SDK cannot create a blob name with "?". So we implement strategy two:
This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped.
This strategy gives us flexibility to create with any special characters. But "%" will be treated as a special characters, if the URL string is not encoded, there shouldn't a "%" in the URL string, otherwise the URL is not a valid URL. If customer needs to create a blob with "%" in it's blob name, use "%25" insead of "%". Just like above 3rd sample. And following URL strings are invalid:
Another special character is "?", use "%2F" to represent a blob name with "?" in a URL string.
containerClient.getBlobClient(blobName)
We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.
Extracts the parts of an Azure Storage account connection string.
Connection string.
String key value pairs of the storage account's url and credentials.
ONLY AVAILABLE IN NODE.JS RUNTIME.
Promisified version of fs.stat().
ONLY AVAILABLE IN NODE.JS RUNTIME.
Generates a SASQueryParameters object which contains all SAS query parameters needed to make an actual REST request.
ONLY AVAILABLE IN NODE.JS RUNTIME.
Creates an instance of SASQueryParameters.
Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startsOn and identifier.
WARNING: When identifier is not provided, permissions and expiresOn are required. You MUST assign value to identifier or expiresOn & permissions manually if you initial with this constructor.
Fill in the required details before running the following snippets.
Example usage:
// Generate service level SAS for a container
const containerSAS = generateBlobSASQueryParameters({
containerName, // Required
permissions: ContainerSASPermissions.parse("racwdl"), // Required
startsOn: new Date(), // Required
expiresOn: new Date(new Date().valueOf() + 86400), // Optional. Date type
ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, // Optional
protocol: SASProtocol.HttpsAndHttp, // Optional
version: "2016-05-31" // Optional
},
sharedKeyCredential // StorageSharedKeyCredential - `new StorageSharedKeyCredential(account, accountKey)`
).toString();
Example using an identifier:
// Generate service level SAS for a container with identifier
// startsOn & permissions are optional when identifier is provided
const identifier = "unique-id";
await containerClient.setAccessPolicy(undefined, [
{
accessPolicy: {
expiresOn: new Date(new Date().valueOf() + 86400), // Date type
permissions: ContainerSASPermissions.parse("racwdl").toString(),
startsOn: new Date() // Date type
},
id: identifier
}
]);
const containerSAS = generateBlobSASQueryParameters(
{
containerName, // Required
identifier // Required
},
sharedKeyCredential // StorageSharedKeyCredential - `new StorageSharedKeyCredential(account, accountKey)`
).toString();
Example using a blob name:
// Generate service level SAS for a blob
const blobSAS = generateBlobSASQueryParameters({
containerName, // Required
blobName, // Required
permissions: BlobSASPermissions.parse("racwd"), // Required
startsOn: new Date(), // Required
expiresOn: new Date(new Date().valueOf() + 86400), // Optional. Date type
cacheControl: "cache-control-override", // Optional
contentDisposition: "content-disposition-override", // Optional
contentEncoding: "content-encoding-override", // Optional
contentLanguage: "content-language-override", // Optional
contentType: "content-type-override", // Optional
ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, // Optional
protocol: SASProtocol.HttpsAndHttp, // Optional
version: "2016-05-31" // Optional
},
sharedKeyCredential // StorageSharedKeyCredential - `new StorageSharedKeyCredential(account, accountKey)`
).toString();
ONLY AVAILABLE IN NODE.JS RUNTIME.
Creates an instance of SASQueryParameters. WARNING: identifier will be ignored when generating user delegation SAS, permissions and expiresOn are required.
Example usage:
// Generate user delegation SAS for a container
const userDelegationKey = await blobServiceClient.getUserDelegationKey(startsOn, expiresOn);
const containerSAS = generateBlobSASQueryParameters({
containerName, // Required
permissions: ContainerSASPermissions.parse("racwdl"), // Required
startsOn, // Required. Date type
expiresOn, // Optional. Date type
ipRange: { start: "0.0.0.0", end: "255.255.255.255" }, // Optional
protocol: SASProtocol.HttpsAndHttp, // Optional
version: "2018-11-09" // Must >= 2018-11-09 to generate user delegation SAS
},
userDelegationKey, // UserDelegationKey
accountName
).toString();
Return value of blobServiceClient.getUserDelegationKey()
ONLY AVAILABLE IN NODE.JS RUNTIME. IMPLEMENTATION FOR API VERSION FROM 2015-04-05 AND BEFORE 2018-11-09.
Creates an instance of SASQueryParameters.
Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startsOn and identifier.
WARNING: When identifier is not provided, permissions and expiresOn are required. You MUST assign value to identifier or expiresOn & permissions manually if you initial with this constructor.
ONLY AVAILABLE IN NODE.JS RUNTIME. IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
Creates an instance of SASQueryParameters.
Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startsOn and identifier.
WARNING: When identifier is not provided, permissions and expiresOn are required. You MUST assign value to identifier or expiresOn & permissions manually if you initial with this constructor.
ONLY AVAILABLE IN NODE.JS RUNTIME. IMPLEMENTATION FOR API VERSION FROM 2018-11-09.
Creates an instance of SASQueryParameters.
Only accepts required settings needed to create a SAS. For optional settings please set corresponding properties directly, such as permissions, startsOn and identifier.
WARNING: identifier will be ignored, permissions and expiresOn are required.
Generate a 64 bytes base64 block ID string.
Extracts account name from the url
url to extract the account name from
with the account name
Get URL parameter by name.
Get URL path from an URL string.
Source URL string
Get URL path and query from an URL string.
Source URL string
Get URL query key value pairs from an URL string.
Get URL scheme from an URL string.
Source URL string
If two strings are equal when compared case insensitive.
Generate SasIPRange format string. For example:
"8.8.8.8" or "1.1.1.1-255.255.255.255"
Creates a new Pipeline object with Credential provided.
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.
A new Pipeline object.
String.prototype.padStart()
Function that converts PageRange and ClearRange to a common Range object. PageRange and ClearRange have start and end while Range offset and count this function normalizes to Range.
Model PageBlob Range response
Generate a range string. For example:
"bytes=255-" or "bytes=0-511"
ONLY AVAILABLE IN NODE.JS RUNTIME.
Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.
The read stream.
Destination file path.
Set URL host.
Source URL string
New host string
An updated URL string
Set URL parameter name and value. If name exists in URL parameters, old value will be replaced by name key. If not provide value, the parameter will be deleted.
Source URL string
Parameter name
An updated URL string
Reads a readable stream into buffer. Fill the buffer from offset to end.
A Node.js Readable stream
Buffer to be filled, length must >= offset
From which position in the buffer to be filled, inclusive
To which position in the buffer to be filled, exclusive
Reads a readable stream into buffer entirely.
A Node.js Readable stream
Buffer to be filled, length must >= offset
with the count of bytes read.
Rounds a date off to seconds.
Date string in ISO8061 format, with or without 7 milliseconds component
Generated using TypeDoc
Defines values for AccessTier. Possible values include: 'P4', 'P6', 'P10', 'P15', 'P20', 'P30', 'P40', 'P50', 'P60', 'P70', 'P80', 'Hot', 'Cool', 'Archive'