问题
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