在内存中创建文本文件,然后使用Python上传到Azure Blob存储

发布于 2025-02-13 08:11:43 字数 112 浏览 0 评论 0原文

因此,我想创建一个python函数,该函数可以创建一个可以将字符串或多个字符串传递到Azure Blob存储的inmemory文本文件。使用普通文本文件进行是一项新颖的任务,但是我似乎无法使用IO模块来实现它。

So I want to create a python function that creates an inmemory text file that I can pass a string, or multiple strings to and upload to azure blob storage. Doing it with a normal text file is a novel task, but I can't seem to get it happen using the io module.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

此刻的回忆 2025-02-20 08:11:43

请查看此 https://pypipi.org/project/project/azure-staroge-blob/ < /a>通过执行以下操作将文件上传到Azure Blob存储中。

您可以使用python轻松地将字符串传递到upload_blob方法:

blob = BlobClient.from_connection_string(conn_str="<connection_string>", container_name="my_container", blob_name="my_blob")

data = "test"
blob.upload_blob(data)

Please check out this https://pypi.org/project/azure-storage-blob/ which given in detail upload a file to azure blob storage by doing the following.

You can easily pass the string to upload_blob method using python as below:

blob = BlobClient.from_connection_string(conn_str="<connection_string>", container_name="my_container", blob_name="my_blob")

data = "test"
blob.upload_blob(data)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文