Version 12.0.0b5:
Important: This package was previously named azure-storage-file
Going forward, to use this SDK, please install azure-storage-file-share
.
Additionally:
- The namespace within the package has also been renamed to
azure.storage.fileshare
. FileServiceClient
has been renamed toShareServiceClient
.DirectoryClient
has been renamed toShareDirectoryClient
.FileClient
has been renamed toShareFileClient
.
Additional Breaking changes
ShareClient
now accepts onlyaccount_url
with mandatory a string paramshare_name
.
To use a share_url, the methodfrom_share_url
must be used.ShareDirectoryClient
now accepts onlyaccount_url
with mandatory string paramsshare_name
anddirectory_path
.
To use a directory_url, the methodfrom_directory_url
must be used.ShareFileClient
now accepts onlyaccount_url
with mandatory string paramsshare_name
and
file_path
. To use a file_url, the methodfrom_file_url
must be used.file_permission_key
parameter has been renamed topermission_key
set_share_access_policy
has required parametersigned_identifiers
.NoRetry
policy has been removed. Use keyword argumentretry_total=0
for no retries.- Removed types that were accidentally exposed from two modules. Only
ShareServiceClient
,ShareClient
,ShareDirectoryClient
andShareFileClient
should be imported from azure.storage.fileshare.aio - Some parameters have become keyword only, rather than positional. Some examples include:
loop
max_concurrency
validate_content
timeout
etc.
- Client and model files have been made internal. Users should import from the top level modules
azure.storage.fileshare
andazure.storage.fileshare.aio
only. - The
generate_shared_access_signature
methods on each ofShareServiceClient
,ShareClient
andShareFileClient
have been replaced by module level functionsgenerate_account_sas
,generate_share_sas
andgenerate_file_sas
. start_range
andend_range
params are now renamed to and behave likeoffset
andlength
in
the following APIs:- download_file
- upload_range
- upload_range_from_url
- clear_range
- get_ranges
StorageStreamDownloader
is no longer iterable. To iterate over the file data stream, useStorageStreamDownloader.chunks
.- The public attributes of
StorageStreamDownloader
have been limited to:name
(str): The name of the file.path
(str): The full path of the file.share
(str): The share the file will be downloaded from.properties
(FileProperties
): The properties of the file.size
(int): The size of the download. Either the total file size, or the length of a subsection if sepcified. Previously calleddownload_size
.
StorageStreamDownloader
now has new functions:readall()
: Reads the complete download stream, returning bytes. This replaces the functionscontent_as_bytes
andcontent_as_text
which have been deprecated.readinto(stream)
: Download the complete stream into the supplied writable stream, returning the number of bytes written. This replaces the functiondownload_to_stream
which has been deprecated.
ShareFileClient.close_handles
andShareDirectoryClient.close_handles
have both been replaced by two functions each;close_handle(handle)
andclose_all_handles()
. These functions are blocking and return integers (the number of closed handles) rather than polling objects.get_service_properties
now returns a dict with keys consistent toset_service_properties
New features
ResourceTypes
,NTFSAttributes
, andServices
now have methodfrom_string
which takes parameters as a string.