Methods
-
createBlobService(storageAccountOrConnectionString [, storageAccessKey] [, host])
-
Creates a new BlobService object.
If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
environment variables will be used.Parameters:
Name Type Argument Description storageAccountOrConnectionStringstring The storage account or the connection string.
storageAccessKeystring <optional>
The storage access key.
hoststring | object <optional>
The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.- Source:
Returns:
A new BlobService object.
- Type
- BlobService
-
createBlobServiceAnonymous(host)
-
Creates a new BlobService object using the host uri and anonymous access.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.- Source:
Returns:
A new BlobService object with the anonymous credentials.
- Type
- BlobService
-
createBlobServiceWithSas(host, sasToken)
-
Creates a new BlobService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.sasTokenstring The Shared Access Signature token.
- Source:
Returns:
A new BlobService object with the SAS credentials.
- Type
- BlobService
-
createBlobServiceWithTokenCredential(host, tokenCredential)
-
Creates a new BlobService object using the host Uri and the TokenCredential provided, which supports OAuth.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.tokenCredentialTokenCredential The token credential object.
- Source:
Returns:
A new BlobService object with the TokenCredential object.
- Type
- BlobService
Example
var azure = require('azure-storage'); var tokenCredential = new azure.TokenCredential('myOAuthAccessToken'); var blobService = azure.createBlobServiceWithTokenCredential('https://account.blob.core.windows.net', tokenCredential); tokenCredential.set('updatedOAuthAccessToken'); -
createFileService(storageAccountOrConnectionString [, storageAccessKey] [, host])
-
Creates a new FileService object.
If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
environment variables will be used.Parameters:
Name Type Argument Description storageAccountOrConnectionStringstring The storage account or the connection string.
storageAccessKeystring <optional>
The storage access key.
hoststring | object <optional>
The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.- Source:
Returns:
A new FileService object.
- Type
- FileService
-
createFileServiceWithSas(host, sasToken)
-
Creates a new FileService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.sasTokenstring The Shared Access Signature token.
- Source:
Returns:
A new FileService object with the SAS credentials.
- Type
- FileService
-
createQueueService( [storageAccountOrConnectionString] [, storageAccessKey] [, host])
-
Creates a new QueueService object.
If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
environment variables will be used.Parameters:
Name Type Argument Description storageAccountOrConnectionStringstring <optional>
The storage account or the connection string.
storageAccessKeystring <optional>
The storage access key.
hoststring | object <optional>
The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.- Source:
Returns:
A new QueueService object.
- Type
- QueueService
-
createQueueServiceWithSas(host, sasToken)
-
Creates a new QueueService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.sasTokenstring The Shared Access Signature token.
- Source:
Returns:
A new QueueService object with the SAS credentials.
- Type
- QueueService
-
createQueueServiceWithTokenCredential(host, tokenCredential)
-
Creates a new QueueService object using the host Uri and the TokenCredential provided, which supports OAuth.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.tokenCredentialTokenCredential The TokenCredential object.
- Source:
Returns:
A new QueueService object with the TokenCredential object.
- Type
- QueueService
Example
var azure = require('azure-storage'); var tokenCredential = new azure.TokenCredential('myOAuthAccessToken'); var queueService = azure.createQueueServiceWithTokenCredential('https://account.queue.core.windows.net', tokenCredential); tokenCredential.set('updatedOAuthAccessToken'); -
createTableService( [storageAccountOrConnectionString] [, storageAccessKey] [, host])
-
Creates a new TableService object.
If no storageaccount or storageaccesskey are provided, the AZURE_STORAGE_CONNECTION_STRING and then the AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY
environment variables will be used.Parameters:
Name Type Argument Description storageAccountOrConnectionStringstring <optional>
The storage account or the connection string.
storageAccessKeystring <optional>
The storage access key.
hoststring | object <optional>
The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.- Source:
Returns:
A new TableService object.
- Type
- TableService
-
createTableServiceWithSas(host, sasToken)
-
Creates a new TableService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description hoststring | object The host address. To define primary only, pass a string.
Otherwise 'host.primaryHost' defines the primary host and 'host.secondaryHost' defines the secondary host.sasTokenstring The Shared Access Signature token.
- Source:
Returns:
A new TableService object with the SAS credentials.
- Type
- TableService
-
generateAccountSharedAccessSignature( [storageAccountOrConnectionString] [, storageAccessKey], sharedAccessPolicy)
-
Generates an account shared access signature token
Parameters:
Name Type Argument Description storageAccountOrConnectionStringstring <optional>
The storage account or the connection string.
storageAccessKeystring <optional>
The storage access key.
sharedAccessPolicyobject The shared access policy.
Properties
Name Type Description AccessPolicy.ServicesSharedAccessServices The services (blob, file, queue, table) for a shared access signature associated with this shared access policy.
Refer toConstants.AccountSasConstants.Services.AccessPolicy.ResourceTypesSharedAccessResourceTypes The resource type for a shared access signature associated with this shared access policy.
Refer toConstants.AccountSasConstants.ResourceTypes.AccessPolicy.PermissionsSharedAccessPermissions The permissions for a shared access signature.
Refer toConstants.AccountSasConstants.Permissions.AccessPolicy.Startdate The time at which the Shared Access Signature becomes valid.
AccessPolicy.Expirydate The time at which the Shared Access Signature becomes expired.
AccessPolicy.IPAddressOrRangestring The permission type. Refer to
Constants.AccountSasConstants.ResourceTypes.AccessPolicy.Protocolsstring The possible protocols. Refer to
Constants.AccountSasConstants.ResourceTypes.- Source:
-
generateDevelopmentStorageCredentials( [proxyUri])
-
Creates a connection string that can be used to create a service which runs on the storage emulator. The emulator must be downloaded separately.
Parameters:
Name Type Argument Description proxyUristring <optional>
The proxyUri. By default, http://127.0.0.1
- Source:
Returns:
A connection string representing the development storage credentials.
- Type
- string
Example
var azure = require('azure-storage'); var devStoreCreds = azure.generateDevelopmentStorageCredentials(); var blobService = azure.createBlobService(devStoreCreds);
Type Definitions
-
AccessConditions
-
Specifying conditional headers for blob service operations. See http://msdn.microsoft.com/en-us/library/dd179371.aspx for more information.
Type:
- object
- Source:
Properties:
Name Type Description EtagMatchstring If the ETag for the blob matches the specified ETag.
Specify the wildcard character (*) to perform the operation only if the resource does exist, and fail the operation if it does not exist.EtagNonMatchstring If the ETag for the blob does not match the specified ETag.
Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.DateModifedSinceDate | string If the blob has been modified since the specified date.
DateUnModifiedSinceDate | string If the blob has not been modified since the specified date.
SequenceNumberLessThanOrEqualNumber | string If the blob's sequence number is less than or equal to the specified value.
For Put Page operation only. See https://msdn.microsoft.com/en-us/library/azure/ee691975.aspx for more information.SequenceNumberLessThanNumber | string If the blob's sequence number is less than the specified value.
For Put Page operation only. See https://msdn.microsoft.com/en-us/library/azure/ee691975.aspx for more information.SequenceNumberEqualNumber | string If the blob's sequence number is equal to the specified value.
For Put Page operation only. See https://msdn.microsoft.com/en-us/library/azure/ee691975.aspx for more information.MaxBlobSizeNumber | string If the Append Block operation would cause the blob to exceed that limit or if the blob size is already greater than the specified value.
For Append Block operation only. See https://msdn.microsoft.com/en-us/library/mt427365.aspx for more information.MaxAppendPositionNumber | string If the append position is equal to the specified value.
For Append Block operation only. See https://msdn.microsoft.com/en-us/library/mt427365.aspx for more information. -
AccessPolicy
-
The access policy.
Type:
- object
- Source:
Properties:
Name Type Description Permissionsstring The permission type.
StartDate The time at which the access policy becomes valid.
ExpiryDate The time at which the access policy becomes expired.
IPAddressOrRangestring An IP address or a range of IP addresses from which to accept requests. When specifying a range, note that the range is inclusive.
Protocolsstring The protocols permitted for a request made with the SAS.
Servicesstring The services (blob, file, queue, table) for a shared access signature associated with this shared access policy.
ResourceTypesstring The resource type for a shared access signature associated with this shared access policy.
-
AccountProperties
-
The properties of a storage account.
Type:
- object
- Source:
Properties:
Name Type Description SkuNamestring The header that specifies storage SKU, also known as account type.
AccountKindstring The header that describes the flavour of the storage account, also known as account kind.
-
BlobServiceProperties
-
The properties of a blob storage service, including properties of Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and Static Webiste configurations.
Type:
- object
- Source:
Properties:
Name Type Description DefaultServiceVersionstring The default version of Storage Analytics currently in use.
LoggingLoggingProperties The Logging settings.
HourMetricsMetricsProperties The HourMetrics settings provide a summary of request statistics grouped by API in hourly aggregates.
MinuteMetricsMetricsProperties The HourMetrics settings provide request statistics grouped by API for each minute.
StaticWebsiteStaticWebsiteProperties The Azure Static Website settings.
Corsobject Groups all CORS rules.
Properties
Name Type Description CorsRulesArray.<CorsRule> Groups settings for a
CORS rule. -
ContainerAclResult
-
The container ACL settings.
Type:
- object
- Source:
Properties:
Name Type Description signedIdentifiersObject.<string, AccessPolicy> The container ACL settings. See
AccessPolicyfor detailed information. -
CorsRule
-
The CORS rule of a storage service.
Type:
- object
- Source:
Properties:
Name Type Description AllowedMethodsArray.<string> A list of HTTP methods that are allowed to be executed by the origin. For Azure Storage, permitted methods are DELETE, GET, HEAD, MERGE, POST, OPTIONS or PUT.
AllowedOriginsArray.<string> A list of origin domains that are allowed via CORS, or "*" if all domains are allowed.
AllowedHeadersArray.<string> A list of headers allowed to be part of the cross-origin request.
ExposedHeadersArray.<string> A list of response headers to expose to CORS clients.
MaxAgeInSecondsnumber The number of seconds that the client/browser should cache a preflight response.
-
errorOrResponse(error, response)
-
A callback that returns a response object.
Parameters:
Name Type Description errorobject If an error occurs, will contain information about the error.
responseobject Contains information about the response returned for the operation.
For example, HTTP status codes and headers.- Source:
-
errorOrResult(error, result, response)
-
A callback that returns result and response objects.
Parameters:
Name Type Description errorobject If an error occurs, will contain information about the error.
resultobject The result of the operation.
responseobject Contains information about the response returned for the operation.
For example, HTTP status codes and headers.- Source:
-
LoggingProperties
-
The Azure Analytics logging settings.
Type:
- object
- Source:
Properties:
Name Type Description Versionstring The version of Storage Analytics currently in use for logging.
Deleteboolean Indicates whether delete requests are being logged.
Readboolean Indicates whether read requests are being logged.
Writeboolean Indicates whether write requests are being logged.
RetentionPolicyRetentionPolicy The retention policy of the log data.
-
MetricsProperties
-
The setting of Azure Analytics summary of request stastics.
Type:
- object
- Source:
Properties:
Name Type Description Versionstring The version of Storage Analytics currently in use for hour metrics.
Enabledstring Indicates whether metrics are enabled
IncludeAPIsboolean Indicates whether metrics generate summary statistics for called API operations.
RetentionPolicyRetentionPolicy The retention policy of the metrics data.
-
Range
-
The range.
Type:
- object
- Source:
Properties:
Name Type Description startnumber The start of the range.
endnumber The end of the range.
-
RangeDiff
-
The range diff. Refer to https://msdn.microsoft.com/en-us/library/azure/mt736912.aspx
Type:
- object
- Source:
Properties:
Name Type Description startnumber The start of the range.
endnumber The end of the range.
isClearedboolean If the range is cleared or not.
-
RetentionPolicy
-
The Azure Analytics logging or metrics retention policy.
Type:
- object
- Source:
Properties:
Name Type Description Enabledboolean Indicates whether a retention policy is enabled for the storage service.
Daysnumber Indicates the number of days that logging data is retained. All data older than this value will be deleted.
-
ServiceProperties
-
The properties of a storage service, including properties of Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
Type:
- object
- Source:
Properties:
Name Type Description DefaultServiceVersionstring The default version of Storage Analytics currently in use.
LoggingLoggingProperties The Logging settings.
HourMetricsMetricsProperties The HourMetrics settings provide a summary of request statistics grouped by API in hourly aggregates.
MinuteMetricsMetricsProperties The HourMetrics settings provide request statistics grouped by API for each minute.
Corsobject Groups all CORS rules.
Properties
Name Type Description CorsRulesArray.<CorsRule> Groups settings for a
CORS rule. -
ServiceStats
-
The service statistics.
Type:
- object
- Source:
Properties:
Name Type Description GeoReplicationobject The geo replication stastics.
Properties
Name Type Description Statusstring The status of the secondary location.
LastSyncTimeDate A GMT date/time value, to the second.
All primary writes preceding this value are guaranteed to be available for read operations at the secondary.
Primary writes after this point in time may or may not be available for reads. -
The share ACL settings.
Type:
- object
- Source:
Properties:
Name Type Description signedIdentifiersObject.<string, AccessPolicy> The container ACL settings. See
AccessPolicyfor detailed information. -
StaticWebsiteProperties
-
The Azure Static Website settings.
Type:
- object
- Source:
Properties:
Name Type Description Enabledboolean Whether feature of Static Website is enabled.
IndexDocumentstring Indicates index document page path.
ErrorDocument404Pathstring Indicates 404 document page path.