如何在azure存储位置创建子容器
如何在azure存储位置创建子容器?
How can I create a sub container in the azure storage location?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何在azure存储位置创建子容器?
How can I create a sub container in the azure storage location?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
Windows Azure 不提供分层容器的概念,但它确实提供了一种通过约定和 API 遍历分层结构的机制。所有容器均存放在同一层。您可以通过使用 Blob 名称的命名约定来获得类似的功能。
例如,您可以创建一个名为“content”的容器,并在该容器中创建具有以下名称的 blob:
注意这些 blob 是针对“content”容器的平面列表。也就是说,使用“/”作为常规分隔符,为您提供了以分层方式遍历这些分隔符的功能。
然后,您可以按如下方式调用它:
注意使用GetBlobDirectoryReference和GetSubDirectory方法以及CloudBlobDirectory类型而不是CloudBlobContainer。这些提供了您可能正在寻找的遍历功能。
这应该可以帮助您入门。如果这不能回答您的问题,请告诉我:
[ 感谢 Neil Mackenzie 寻找灵感]
Windows Azure doesn't provide the concept of heirarchical containers, but it does provide a mechanism to traverse heirarchy by convention and API. All containers are stored at the same level. You can gain simliar functionality by using naming conventions for your blob names.
For instance, you may create a container named "content" and create blobs with the following names in that container:
Note that these blobs are a flat list against your "content" container. That said, using the "/" as a conventional delimiter, provides you with the functionality to traverse these in a heirarchical fashion.
You can then call this as follows:
Note the use of GetBlobDirectoryReference and GetSubDirectory methods and the CloudBlobDirectory type instead of CloudBlobContainer. These provide the traversal functionality you are likely looking for.
This should help you get started. Let me know if this doesn't answer your question:
[ Thanks to Neil Mackenzie for inspiration ]
您指的是 blob 存储吗?如果是这样,层次结构就是 StorageAccount/Container/BlobName。没有嵌套容器。
尽管如此,您可以在 blob 名称中使用斜杠来模拟 URI 中的嵌套容器。有关命名详细信息,请参阅MSDN 上的这篇文章。
Are you referring to blob storage? If so, the hierarchy is simply StorageAccount/Container/BlobName. There are no nested containers.
Having said that, you can use slashes in your blob name to simulate nested containers in the URI. See this article on MSDN for naming details.
我同意托宾特的回答,我想在这种情况下添加一些内容,因为我也
我需要以相同的方式将我的游戏 html 上传到 Azure 存储并创建以下目录:
因此,在您的建议之后,我尝试使用 Azure Storage Explorer 工具上传我的内容,您可以使用以下网址下载工具和源代码: Azure 存储资源管理器
首先,我尝试通过工具上传,但它不允许分层目录上传,因为你不需要: 如何在 blob 容器中创建子目录
最后,我调试 Azure 存储Explorer 源代码和我编辑了 StorageAccountViewModel.cs 文件中的 Background_UploadBlobs 方法和 UploadFileList 字段。您可以编辑您想要的内容。我可能犯了拼写错误:/我很抱歉,但这只是我的建议。
I aggree with tobint answer and I want to add something this situation because I also
I need the same way upload my games html to Azure Storage with create this directories :
So After your recommends I tried to upload my content with tool which is Azure Storage Explorer and you can download tool and source code with this url : Azure Storage Explorer
First of all I tried to upload via tool but It doesn't allow to hierarchical directory upload because you don't need : How to create sub directory in a blob container
Finally, I debug Azure Storage Explorer source code and I edited Background_UploadBlobs method and UploadFileList field in StorageAccountViewModel.cs file. You can edit it what you wants.I may have made spelling errors :/ I am so sorry but That's only my recommend.
如果您要从 Azure 门户上传文件:
要在容器中创建子文件夹,在上传文件时,您可以转到高级选项并选择上传到文件夹,这将在容器中创建一个新文件夹并将文件上传到其中。
If you are tying to upload files from Azure portal:
To create a sub folder in container, while uploading a file you can go to Advanced options and select upload to a folder, which will create a new folder in the container and upload the file into that.
Kotlin 代码
将创建以 TimeStamp 为名称的目录,其中包含您的 Blob 文件。请注意上面代码中斜杠 (/) 的使用,它将通过创建名为前面的斜杠字符串的文件夹来嵌套 blob 文件。
它在门户上看起来像这样
Kotlin Code
this will create directory having TimeStamp as name and inside that there will be your Blob File. Notice the use of slash (/) in above code which will nest your blob file by creating folder named as previous string of slash.
It will look like this on portal
示例代码
Sample code