AbstractAzureStorageDatastore Class

Represents the base class for datastores that save connection information to Azure Blob and Azure File storage.

You should not work with this class directly. To create a datastore, use one of the register* methods of the Datastore class, for example, register_azure_blob_container.

Note: When using a datastore to access data, you must have permission to access the data, which depends on the credentials registered with the datastore.

Inheritance
AbstractAzureStorageDatastore

Constructor

AbstractAzureStorageDatastore(workspace, name, datastore_type, container_name, account_name, sas_token=None, account_key=None, protocol=None, endpoint=None)

Parameters

workspace
Workspace

The workspace this datastore belongs to.

name
str

The name of the datastore. It can only contain alphanumeric characters or - or _.

datastore_type
str

The type of this datastore, either "AzureBlob" or "AzureFile".

container_name
str

The container name.

account_name
str

The storage account name.

sas_token
str, <xref:optional>

The SAS token for accessing this container, defaults to None.

account_key
str, <xref:optional>

The storage account key, defaults to None.

protocol
str, <xref:optional>

The protocol to use to connect to the storage account. If None, defaults to https.

endpoint
str, <xref:optional>

The endpoint of the blob container. If None, defaults to core.windows.net.

Methods

as_download

Return data reference object with download mode.

as_mount

Return data reference object with mount mode.

as_upload

Return data reference object with upload mode.

download

Download paths with prefix to target_path.

path

Return corresponding data reference object.

upload

Upload src_dir to target_path.

upload_files

Upload files to target_path.

as_download

Return data reference object with download mode.

as_download(path_on_compute=None)

Parameters

path_on_compute
str
default value: None

The relative path on the compute.

Returns

The data reference object.

Return type

as_mount

Return data reference object with mount mode.

as_mount()

Parameters

path_on_compute
str

The relative path on the compute.

Returns

The data reference object.

Return type

as_upload

Return data reference object with upload mode.

as_upload(path_on_compute=None)

Parameters

path_on_compute
str
default value: None

The relative path on the compute.

Returns

The data reference object.

Return type

download

Download paths with prefix to target_path.

download(target_path, prefix=None, overwrite=False, show_progress=True)

Parameters

target_path
prefix
default value: None
overwrite
default value: False
show_progress
default value: True

path

Return corresponding data reference object.

path(path=None, data_reference_name=None)

Parameters

path
str
default value: None

The relative path on the datastore.

data_reference_name
str
default value: None

The name of the data reference.

Returns

The data reference object.

Return type

upload

Upload src_dir to target_path.

upload(src_dir, target_path=None, overwrite=False, show_progress=True)

Parameters

src_dir
target_path
default value: None
overwrite
default value: False
show_progress
default value: True

upload_files

Upload files to target_path.

upload_files(files, relative_root=None, target_path=None, overwrite=False, show_progress=True)

Parameters

files
relative_root
default value: None

relative path in target

target_path
default value: None
overwrite
default value: False
show_progress
default value: True

Attributes

is_sas

Deprecated -- use credential_type property.

This property is deprecated, please use the property credential_type to determine the credential type.