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

workspace
Workspace
Required

The workspace this datastore belongs to.

name
str
Required

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

datastore_type
str
Required

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

container_name
str
Required

The container name.

account_name
str
Required

The storage account name.

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

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

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

The storage account key, defaults to None.

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

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

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

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

workspace
Workspace
Required

The workspace this datastore belongs to.

name
str
Required

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

datastore_type
str
Required

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

container_name
str
Required

The container name.

account_name
str
Required

The storage account name.

sas_token
str, <xref:optional>
Required

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

account_key
str, <xref:optional>
Required

The storage account key, defaults to None.

protocol
str, <xref:optional>
Required

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

endpoint
str, <xref:optional>
Required

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

path_on_compute
str
Required

The relative path on the compute.

Returns

The data reference object.

Return type

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

path_on_compute
str
Required

The relative path on the compute.

Returns

The data reference object.

Return type

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

path_on_compute
str
Required

The relative path on the compute.

Returns

The data reference object.

Return type

download

Download paths with prefix to target_path.

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

Parameters

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

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.

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

Parameters

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

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

use credential_type property.

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