AbstractAzureStorageDatastore class

Definition

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(workspace, datastore_name, container_name, account_name, sas_token=None, account_key=None, protocol=None, endpoint=None, overwrite=False, create_if_not_exists=False, skip_validation=False, blob_cache_timeout=None, grant_workspace_access=False, subscription_id=None, resource_group=None).

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.

AbstractAzureStorageDatastore(workspace, name, datastore_type, container_name, account_name, sas_token=None, account_key=None, protocol=None, endpoint=None)
Inheritance
builtins.object
AbstractAzureStorageDatastore

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, optional

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

account_key
str, optional

The storage account key, defaults to None.

protocol
str, optional

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

endpoint
str, optional

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

Methods

as_download(path_on_compute=None)

Return data reference object with download mode.

as_mount()

Return data reference object with mount mode.

as_upload(path_on_compute=None)

Return data reference object with upload mode.

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

Download paths with prefix to target_path.

path(path=None, data_reference_name=None)

Return corresponding data reference object.

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

Upload src_dir to target_path.

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

Upload files to target_path.

as_download(path_on_compute=None)

Return data reference object with download mode.

as_download(path_on_compute=None)

Parameters

path_on_compute
str

The relative path on the compute.

default value: None

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(path_on_compute=None)

Return data reference object with upload mode.

as_upload(path_on_compute=None)

Parameters

path_on_compute
str

The relative path on the compute.

default value: None

Returns

The data reference object.

Return type

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

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(path=None, data_reference_name=None)

Return corresponding data reference object.

path(path=None, data_reference_name=None)

Parameters

path
str

The relative path on the datastore.

default value: None
data_reference_name
str

The name of the data reference.

default value: None

Returns

The data reference object.

Return type

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

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(files, relative_root=None, target_path=None, overwrite=False, show_progress=True)

Upload files to target_path.

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

Parameters

files
relative_root

relative path in target

default value: None
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.