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-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/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(),