- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试将 JSON 文件上传到 Azure blob 存储帐户上的新容器中。 I use Microsoft quick guide目前我的代码如下所示:
>import os, uuid
>from azure.storage.blob import BlobServiceClient, BlobClient, ContainerClient
>connect_str = os.getenv('AZURE_STORAGE_CONNECTION_STRING')
So far It's works OK but when I add this line
>blob_service_client = BlobServiceClient.from_connection_string(connect_str)
我收到一条错误消息:
>(base) "`my file path`"
Traceback (most recent call last):
File "`my file path`", line 14, in <module>
blob_service_client = BlobServiceClient.from_connection_string(connect_str)
File `".../anaconda3/lib/python3.8/site-packages/azure/storage/blob/_blob_service_client.py"`, line 174, in from_connection_string
account_url, secondary, credential = parse_connection_str(conn_str, credential, 'blob')
File `".../anaconda3/lib/python3.8/site-packages/azure/storage/blob/_shared/base_client.py"`, line 363, in parse_connection_str
conn_str = conn_str.rstrip(";")
AttributeError: 'NoneType' object has no attribute 'rstrip'
我在我的 PC 上编写了相同的代码,大约一个月前我转向了 Mac OS。我以为我做了所有相关的调整,但显然没有。由于这台 Mac 是全新的,我想我缺少一些软件包,或者可能有错误版本的软件包。
我正在附加点列表:
azure-common 1.1.27
azure 核心1.12.0
azure-nspkg 3.0.2
azure 存储0.36.0
azure 存储blob 12.9.0
谢谢!
最佳答案
您的环境变量可能未找到。试试这个代码
connect_str = os.environ['AZURE_STORAGE_CONNECTION_STRING']
它应该引发 KeyError
或返回 None
。我认为您应该确保该变量确实被读取或其值不是 None
。
关于python - BlobServiceClient.from_connection_string(connect_str) 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69508794/
我正在尝试使用此 github ( https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storag
我创建了一个 azure 管道。添加了从 blobStorage 下载文件的任务。 但我收到以下错误: ERROR: The command failed with an unexpected err
我正在尝试使用此 github ( https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/storage/azure-storag
我创建了一个 azure 管道。添加了从 blobStorage 下载文件的任务。 但我收到以下错误: ERROR: The command failed with an unexpected err
我的配置文件中有一个 Azure Blob 存储连接字符串,例如: "Storage": "DefaultEndpointsProtocol=https;AccountName=xyz;Account
我收到一个 ImportError from azure.storage.blob import BlobServiceClient 但是我意识到当我安装依赖项时会发生错误 pip install a
我正在尝试将 JSON 文件上传到 Azure blob 存储帐户上的新容器中。 I use Microsoft quick guide目前我的代码如下所示: >import os, uuid >fr
这看起来应该非常简单,但是,无论出于何种原因,这些选项对我来说没有意义。我正在实例化 BlobServiceClient: this.FileClient = new BlobServiceClien
这看起来应该非常简单,但是,无论出于何种原因,这些选项对我来说没有意义。我正在实例化 BlobServiceClient: this.FileClient = new BlobServiceClien
我见过的大多数(全部?)Azure 存储 Python SDK 示例都演示了创建一个 BlobServiceClient,然后创建一个 BlobClient 来上传/下载 blob( ref1 , r
我有一个旧的 Azure 函数,它使用 BlockBlobService ->get_blob_to_bytes。如此处所述:https://github.com/uglide/azure-conte
我当前正在使用以下设置在 Azure 存储帐户中创建容器,并将 blob 写入这些容器: from azure.storage.blob import BlobServiceClient connst
我有以下代码行: from azure.storage.blob import BlobServiceClient 我收到以下错误: from azure.storage.blob import Bl
我是 Azure 新手。我正在尝试创建简单的 Java 应用程序来连接,然后从 Blob 容器下载数据我从创造开始这是代码片段 String sasToken = "my blob sas token
这段代码在我的个人电脑上运行良好 from azure.storage.blob import BlobServiceClient blob_client = BlobClient.from_blob
我正在尝试使用 StartCopyFromUri 或 StartCopyFromUriAsync 将 blob 从一个存储帐户复制到另一个存储帐户。即使 status.HasCompleted 当我尝
在 Azure 存储 v12 SDK 中,如何使用 Blob URI 和 BlobServiceClient 创建 Blob 客户端? 在 v11 中,我们可以通过以下方式做到这一点: var clo
我正在尝试使用 StartCopyFromUri 或 StartCopyFromUriAsync 将 blob 从一个存储帐户复制到另一个存储帐户。即使 status.HasCompleted 当我尝
在 Azure 存储 v12 SDK 中,如何使用 Blob URI 和 BlobServiceClient 创建 Blob 客户端? 在 v11 中,我们可以通过以下方式做到这一点: var clo
在 v11 SDK for .NET我能够使用托管身份 token 来访问 Azure blob: var token = await new AzureServiceTokenProvider().
我是一名优秀的程序员,十分优秀!