简体   繁体   中英

Azure Media Services v3 shared access policy for download link

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.

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://learn.microsoft.com/en-us/rest/api/media/assets/createorupdate#definitions ) to get the Storage container name that is associated with the asset.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM