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. FileServiceClienthas been renamed toShareServiceClient.DirectoryClienthas been renamed toShareDirectoryClient.FileClienthas been renamed toShareFileClient.
Additional Breaking changes
ShareClientnow accepts onlyaccount_urlwith mandatory a string paramshare_name.
To use a share_url, the methodfrom_share_urlmust be used.ShareDirectoryClientnow accepts onlyaccount_urlwith mandatory string paramsshare_nameanddirectory_path.
To use a directory_url, the methodfrom_directory_urlmust be used.ShareFileClientnow accepts onlyaccount_urlwith mandatory string paramsshare_nameand
file_path. To use a file_url, the methodfrom_file_urlmust be used.file_permission_keyparameter has been renamed topermission_keyset_share_access_policyhas required parametersigned_identifiers.NoRetrypolicy has been removed. Use keyword argumentretry_total=0for no retries.- Removed types that were accidentally exposed from two modules. Only
ShareServiceClient,ShareClient,ShareDirectoryClientandShareFileClientshould be imported from azure.storage.fileshare.aio - Some parameters have become keyword only, rather than positional. Some examples include:
loopmax_concurrencyvalidate_contenttimeoutetc.
- Client and model files have been made internal. Users should import from the top level modules
azure.storage.fileshareandazure.storage.fileshare.aioonly. - The
generate_shared_access_signaturemethods on each ofShareServiceClient,ShareClientandShareFileClienthave been replaced by module level functionsgenerate_account_sas,generate_share_sasandgenerate_file_sas. start_rangeandend_rangeparams are now renamed to and behave likeoffsetandlengthin
the following APIs:- download_file
- upload_range
- upload_range_from_url
- clear_range
- get_ranges
StorageStreamDownloaderis no longer iterable. To iterate over the file data stream, useStorageStreamDownloader.chunks.- The public attributes of
StorageStreamDownloaderhave 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.
StorageStreamDownloadernow has new functions:readall(): Reads the complete download stream, returning bytes. This replaces the functionscontent_as_bytesandcontent_as_textwhich 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_streamwhich has been deprecated.
ShareFileClient.close_handlesandShareDirectoryClient.close_handleshave 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_propertiesnow returns a dict with keys consistent toset_service_properties
New features
ResourceTypes,NTFSAttributes, andServicesnow have methodfrom_stringwhich takes parameters as a string.