Azure Media Services v3 shared access policy for download link

送分小仙女□ 提交于 2021-01-29 09:16:58

问题


How to secure download links created via Azure Media Services transformation job (and locator)?

I'm aware of using AES or DRM encryption for video streams created by Azure Media Services, however, I haven't found any info on how to secure download links.

I'm getting my download paths for my streaming locator like:

var locator = new StreamingLocator { AssetName = assetName, StreamingPolicyName = PredefinedStreamingPolicy.DownloadAndClearStreaming };
ListPathsResponse paths = await client.StreamingLocators.ListPathsAsync(config.ResourceGroup, config.AccountName, locatorName);

And then creating download links like:

foreach (var path in paths.DownloadPaths)
{
  UriBuilder uriBuilder = new UriBuilder();
  uriBuilder.Scheme = "https";
  uriBuilder.Host = streamingEndpoint.HostName;

  uriBuilder.Path = path;
  downloadUrls.Add(uriBuilder.ToString());
}

I assume I should pass a specific policy when creating a locator, nevertheless, I was not able to find any relevant resources to achieve such behavior.

I've found many pieces of information about legacy v2's sas URLs and access policies for REST but no luck with v3 and .net.

Thank you.


回答1:


For the Media Services v3 API you should actually use the Storage APIs to create SAS URLs. You can use the Asset.container (see https://docs.microsoft.com/en-us/rest/api/media/assets/createorupdate#definitions) to get the Storage container name that is associated with the asset.



来源:https://stackoverflow.com/questions/60364184/azure-media-services-v3-shared-access-policy-for-download-link

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!