c# - 在 Blob 存储中组织 Azure 媒体 Assets

标签 c# azure-storage azure-media-services

我正在使用 Azure 媒体服务来摄取/转码和交付 Web 应用程序的内容。同一 Web 应用程序使用 Blob 存储来存储用户 Assets 。

就目前而言,每当我将新项目摄取到 AMS 中时,我都会在 blob 存储中创建一个具有 Assets 名称的新容器。 有没有办法配置 AMS 以使用子容器?我更愿意将媒体 Assets 组织在它们自己的目录中。而不是仅仅坐在我的存储帐户的顶层?

最佳答案

Azure 存储没有像文件夹这样的物理层次结构。 azure storage api 中有一个选项可以通过在 blob 名称中包含“/”来模拟树层次结构。查看相关帖子 here

Windows Azure 媒体服务目前不支持此类命名约定。一旦您尝试使用 .net sdk 上传文件,其中物理文件名名称与 IAssetFile.Name 不匹配,您将得到异常:

System.ArgumentException:上传的文件名应该与 IAssetFile.Name 属性相同(不区分大小写)

 IAsset asset = _dataContext.Assets.Create(containerName, AssetCreationOptions.None);
 var file = asset.AssetFiles.Create("Folder/Subfolder" + Guid.NewGuid().ToString());
 file.Upload(_smallWmv);

关于c# - 在 Blob 存储中组织 Azure 媒体 Assets ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16540457/

相关文章:

c# - 如何将二进制值放置到多维字符串数组的特定位置?

azure - 使用 Azure 存储 REST API 版本 >= 2019-02-02 指定文件系统属性

c# - 为什么 VS 2017 建议用方法替换属性?

c# - Intellisense 无法从扩展方法推断类型

azure-storage - 为什么 Azure 存储队列上的 ApproximateMessageCount 属性可以为空?

azure - 从 azure 高级存储转换为标准存储磁盘,没有数据丢失风险

azure - 如何在Android上运行azure媒体播放器

Azure 媒体服务 - 允许流式传输到特定域

azure - 分析视频流的条件

c# 处理字符串中的单双引号(json)