diff --git a/sdk/storage/azure-storage-blob/HISTORY.md b/sdk/storage/azure-storage-blob/HISTORY.md index 6c7087107216..aa7728a5f3b0 100644 --- a/sdk/storage/azure-storage-blob/HISTORY.md +++ b/sdk/storage/azure-storage-blob/HISTORY.md @@ -22,7 +22,10 @@ **Dependency updates** - Adopted [azure-core](https://pypi.org/project/azure-core/) 1.0.0b2 - If you later want to revert to azure-storage-blob 12.0.0b1, or another Azure SDK - library requiring azure-core 1.0.0b1, you'll need to `pip uninstall azure-core` + library requiring azure-core 1.0.0b1, you must explicitly install azure-core + 1.0.0b1 as well. For example: + + `pip install azure-core==1.0.0b1 azure-storage-blob==12.0.0b1` **Fixes and improvements** - Fix for SAS URL encoding (#6500) diff --git a/sdk/storage/azure-storage-blob/README.md b/sdk/storage/azure-storage-blob/README.md index 798975d62182..9cc1f7ff1af1 100644 --- a/sdk/storage/azure-storage-blob/README.md +++ b/sdk/storage/azure-storage-blob/README.md @@ -133,7 +133,8 @@ from azure.storage.blob import BlobClient blob = BlobClient.from_connection_string("my_connection_string", container="mycontainer", blob="my_blob") with open("./BlockDestination.txt", "wb") as my_blob: - my_blob.writelines(blob.download_blob()) + blob_data = blob.download_blob() + my_blob.writelines(blob_data.content_as_bytes()) ``` ### Enumerating blobs diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py index c6819aa59ca7..d2f21e4f30fe 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py @@ -65,7 +65,10 @@ def _create_pipeline(self, credential, **kwargs): if 'connection_timeout' not in kwargs: kwargs['connection_timeout'] = DEFAULT_SOCKET_TIMEOUT[0] # type: ignore if not config.transport: - from azure.core.pipeline.transport import AioHttpTransport + try: + from azure.core.pipeline.transport import AioHttpTransport + except ImportError: + raise ImportError("Unable to create async transport. Please check aiohttp is installed.") config.transport = AioHttpTransport(**kwargs) policies = [ QueueMessagePolicy(), diff --git a/sdk/storage/azure-storage-blob/tests/test_block_blob_sync_copy_async.py b/sdk/storage/azure-storage-blob/tests/test_block_blob_sync_copy_async.py index d620648e2088..06c6095e56dd 100644 --- a/sdk/storage/azure-storage-blob/tests/test_block_blob_sync_copy_async.py +++ b/sdk/storage/azure-storage-blob/tests/test_block_blob_sync_copy_async.py @@ -66,9 +66,6 @@ def setUp(self): self.source_blob_data = self.get_random_bytes(SOURCE_BLOB_SIZE) blob = self.bsc.get_blob_client(self.container_name, self.source_blob_name) - if not self.is_playback(): - self.bsc.create_container(self.container_name) - blob.upload_blob(self.source_blob_data) # generate a SAS so that it is accessible with a URL sas_token = blob.generate_shared_access_signature( diff --git a/sdk/storage/azure-storage-file/HISTORY.md b/sdk/storage/azure-storage-file/HISTORY.md index c0979b74ace4..93483d11dcea 100644 --- a/sdk/storage/azure-storage-file/HISTORY.md +++ b/sdk/storage/azure-storage-file/HISTORY.md @@ -20,7 +20,10 @@ **Dependency updates** - Adopted [azure-core](https://pypi.org/project/azure-core/) 1.0.0b2 - If you later want to revert to azure-storage-file 12.0.0b1, or another Azure SDK - library requiring azure-core 1.0.0b1, you'll need to `pip uninstall azure-core` + library requiring azure-core 1.0.0b1, you must explicitly install azure-core + 1.0.0b1 as well. For example: + + `pip install azure-core==1.0.0b1 azure-storage-file==12.0.0b1` **Fixes and improvements** - Fix for closing file handles - continuation token was not being passed to subsequent calls. diff --git a/sdk/storage/azure-storage-file/README.md b/sdk/storage/azure-storage-file/README.md index 4187115db674..ac9afb148da0 100644 --- a/sdk/storage/azure-storage-file/README.md +++ b/sdk/storage/azure-storage-file/README.md @@ -120,10 +120,10 @@ Upload a file to the share ```python from azure.storage.file import FileClient -file = FileClient.from_connection_string("my_connection_string", share="share", file_path="myfile") +file_client = FileClient.from_connection_string("my_connection_string", share="share", file_path="myfile") with open("./SampleSource.txt", "rb") as source_file: - file.upload_file(source_file) + file_client.upload_file(source_file) ``` ## Troubleshooting diff --git a/sdk/storage/azure-storage-file/azure/storage/file/_shared/base_client_async.py b/sdk/storage/azure-storage-file/azure/storage/file/_shared/base_client_async.py index eb8e9629c14b..19a27ba24eb0 100644 --- a/sdk/storage/azure-storage-file/azure/storage/file/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-file/azure/storage/file/_shared/base_client_async.py @@ -64,7 +64,10 @@ def _create_pipeline(self, credential, **kwargs): if 'connection_timeout' not in kwargs: kwargs['connection_timeout'] = DEFAULT_SOCKET_TIMEOUT[0] # type: ignore if not config.transport: - from azure.core.pipeline.transport import AioHttpTransport + try: + from azure.core.pipeline.transport import AioHttpTransport + except ImportError: + raise ImportError("Unable to create async transport. Please check aiohttp is installed.") config.transport = AioHttpTransport(**kwargs) policies = [ QueueMessagePolicy(), diff --git a/sdk/storage/azure-storage-queue/HISTORY.md b/sdk/storage/azure-storage-queue/HISTORY.md index ce8c1f082b2d..59283003b40e 100644 --- a/sdk/storage/azure-storage-queue/HISTORY.md +++ b/sdk/storage/azure-storage-queue/HISTORY.md @@ -18,7 +18,10 @@ **Dependency updates** - Adopted [azure-core](https://pypi.org/project/azure-core/) 1.0.0b2 - If you later want to revert to azure-storage-queue 12.0.0b1, or another Azure SDK - library requiring azure-core 1.0.0b1, you'll need to `pip uninstall azure-core` + library requiring azure-core 1.0.0b1, you must explicitly install azure-core + 1.0.0b1 as well. For example: + + `pip install azure-core==1.0.0b1 azure-storage-queue==12.0.0b1` **Fixes and improvements** - General refactor of duplicate and shared code. diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models.py index 1ecda4acd2cc..e83a319b25b4 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_generated/models/_models.py @@ -597,9 +597,6 @@ class StorageServiceProperties(Model): 'hour_metrics': {'key': 'HourMetrics', 'type': 'Metrics', 'xml': {'name': 'HourMetrics'}}, 'minute_metrics': {'key': 'MinuteMetrics', 'type': 'Metrics', 'xml': {'name': 'MinuteMetrics'}}, 'cors': {'key': 'Cors', 'type': '[CorsRule]', 'xml': {'name': 'Cors', 'itemsName': 'CorsRule', 'wrapped': True}}, - 'default_service_version': {'key': 'DefaultServiceVersion', 'type': 'str', 'xml': {'name': 'DefaultServiceVersion'}}, - 'delete_retention_policy': {'key': 'DeleteRetentionPolicy', 'type': 'RetentionPolicy', 'xml': {'name': 'DeleteRetentionPolicy'}}, - 'static_website': {'key': 'StaticWebsite', 'type': 'StaticWebsite', 'xml': {'name': 'StaticWebsite'}}, } _xml_map = { } diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py index eb8e9629c14b..19a27ba24eb0 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py @@ -64,7 +64,10 @@ def _create_pipeline(self, credential, **kwargs): if 'connection_timeout' not in kwargs: kwargs['connection_timeout'] = DEFAULT_SOCKET_TIMEOUT[0] # type: ignore if not config.transport: - from azure.core.pipeline.transport import AioHttpTransport + try: + from azure.core.pipeline.transport import AioHttpTransport + except ImportError: + raise ImportError("Unable to create async transport. Please check aiohttp is installed.") config.transport = AioHttpTransport(**kwargs) policies = [ QueueMessagePolicy(),