Methods
-
createBlobService(storageAccountOrConnectionString, storageAccessKey, host) → {BlobService}
-
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 storageAccountOrConnectionString
string The storage account or the connection string.
storageAccessKey
string <optional>
The storage access key.
host
string | 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) → {BlobService}
-
Creates a new BlobService object using the host uri and anonymous access.
Parameters:
Name Type Description host
string | 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) → {BlobService}
-
Creates a new BlobService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description host
string | 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.
sasToken
string The Shared Access Signature token.
- Source:
Returns:
A new BlobService object with the SAS credentials.
- Type
- BlobService
-
createFileService(storageAccountOrConnectionString, storageAccessKey, host) → {FileService}
-
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 storageAccountOrConnectionString
string The storage account or the connection string.
storageAccessKey
string <optional>
The storage access key.
host
string | 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) → {FileService}
-
Creates a new FileService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description host
string | 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.
sasToken
string The Shared Access Signature token.
- Source:
Returns:
A new FileService object with the SAS credentials.
- Type
- FileService
-
createQueueService(storageAccountOrConnectionString, storageAccessKey, host) → {QueueService}
-
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 storageAccountOrConnectionString
string <optional>
The storage account or the connection string.
storageAccessKey
string <optional>
The storage access key.
host
string | 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) → {QueueService}
-
Creates a new QueueService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description host
string | 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.
sasToken
string The Shared Access Signature token.
- Source:
Returns:
A new QueueService object with the SAS credentials.
- Type
- QueueService
-
createTableService(storageAccountOrConnectionString, storageAccessKey, host) → {TableService}
-
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 storageAccountOrConnectionString
string <optional>
The storage account or the connection string.
storageAccessKey
string <optional>
The storage access key.
host
string | 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) → {TableService}
-
Creates a new TableService object using the host Uri and the SAS credentials provided.
Parameters:
Name Type Description host
string | 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.
sasToken
string 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 storageAccountOrConnectionString
string <optional>
The storage account or the connection string.
storageAccessKey
string <optional>
The storage access key.
sharedAccessPolicy
object The shared access policy.
Properties
Name Type Description AccessPolicy.Services
SharedAccessServices The services (blob, file, queue, table) for a shared access signature associated with this shared access policy. Refer to
Constants.AccountSasConstants.Services
.AccessPolicy.ResourceTypes
SharedAccessResourceTypes The resource type for a shared access signature associated with this shared access policy. Refer to
Constants.AccountSasConstants.ResourceTypes
.AccessPolicy.Permissions
SharedAccessPermissions The permissions for a shared access signature. Refer to
Constants.AccountSasConstants.Permissions
.AccessPolicy.Start
date The time at which the Shared Access Signature becomes valid.
AccessPolicy.Expiry
date The time at which the Shared Access Signature becomes expired.
AccessPolicy.IPAddressOrRange
string The permission type. Refer to
Constants.AccountSasConstants.ResourceTypes
.AccessPolicy.Protocol
string The possible protocol. Refer to
Constants.AccountSasConstants.ResourceTypes
.- Source:
-
generateDevelopmentStorageCredentials(proxyUri) → {string}
-
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 proxyUri
string <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
-
errorOrResponse(error, response)
-
A callback that returns a response object.
Parameters:
Name Type Description error
object If an error occurs, will contain information about the error.
response
object 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 error
object If an error occurs, will contain information about the error.
result
object The result of the operation.
response
object Contains information about the response returned for the operation. For example, HTTP status codes and headers.
- Source: