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.

Class AbstractAzureStorageDatastore constructor.

Inheritance
AbstractAzureStorageDatastore

Constructor

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

Parameters

Name Description
workspace
Required

The workspace this datastore belongs to.

name
Required
str

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

datastore_type
Required
str

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

container_name
Required
str

The container name.

account_name
Required
str

The storage account name.

sas_token
str, <xref:optional>

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

default value: None
account_key
str, <xref:optional>

The storage account key, defaults to None.

default value: None
protocol
str, <xref:optional>

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

default value: None
endpoint
str, <xref:optional>

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

default value: None
workspace
Required

The workspace this datastore belongs to.

name
Required
str

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

datastore_type
Required
str

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

container_name
Required
str

The container name.

account_name
Required
str

The storage account name.

sas_token
Required
str, <xref:optional>

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

account_key
Required
str, <xref:optional>

The storage account key, defaults to None.

protocol
Required
str, <xref:optional>

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

endpoint
Required
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.

Note: This method is deprecated and will no longer be supported. Recommend to use file_dataset.as_download instead.

as_mount

Return data reference object with mount mode.

Note: This method is deprecated and will no longer be supported. Recommend to use file_dataset.as_mount instead.

as_upload

Return data reference object with upload mode.

Note: This method is deprecated and will no longer be supported. Recommend to use dataset to upload instead.

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.

Note: This method is deprecated and will no longer be supported. Recommend to use file_dataset.as_download instead.

as_download(path_on_compute=None)

Parameters

Name Description
path_on_compute
Required
str

The relative path on the compute.

Returns

Type Description

The data reference object.

as_mount

Return data reference object with mount mode.

Note: This method is deprecated and will no longer be supported. Recommend to use file_dataset.as_mount instead.

as_mount()

Parameters

Name Description
path_on_compute
Required
str

The relative path on the compute.

Returns

Type Description

The data reference object.

as_upload

Return data reference object with upload mode.

Note: This method is deprecated and will no longer be supported. Recommend to use dataset to upload instead.

as_upload(path_on_compute=None)

Parameters

Name Description
path_on_compute
Required
str

The relative path on the compute.

Returns

Type Description

The data reference object.

download

Download paths with prefix to target_path.

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

Parameters

Name Description
target_path
Required
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

Name Description
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

Type Description

The data reference object.

upload

Upload src_dir to target_path.

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

Parameters

Name Description
src_dir
Required
target_path
default value: None
overwrite
default value: False
show_progress
default value: True

upload_files

Upload files to target_path.

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

Parameters

Name Description
files
Required
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

use credential_type property.

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