Azure 媒体服务 (v3) - 特定输出资产容器名称
Azure Media Services (v3) - specific output asset container name
我有一个类似于 AMSV3Quickstarts 示例的程序,我需要根据我的程序 logic/contract 更改输出资产容器的默认名称。是否可以以某种方式更改输出资产容器名称?
我尝试了什么:
- RTFM
- 更改转换作业名称
- 更改定位器名称
- 更改输出资产名称
但是,在我的 blob 存储中,它仍然是 asset-{GUID}
格式。
使用 REST API 创建资产时,您可以设置容器名称:
https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaServices/:accountName/assets/:assetName?api-version={{api-version}}
{
"properties": {
"description": "A documentary showing the ascent of Mount Logan",
"alternateId": "(Optional) some GUID",
"storageAccountName": "(Optional) someStorageAccount",
"container": "(Optional) custom container name if you want"
}
}
使用 .NET SDK 时,资产模型包含相同的参数:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.media.models.asset?view=azure-dotnet
感谢您的快速回答!你是对的,工作很有魅力。非常感谢您的回答。
对于未来的我(和其他人),这是工作代码:
private static async Task<Asset> CreateOutputAssetAsync(IAzureMediaServicesClient client, string resourceGroupName, string accountName, string assetName)
{
Asset asset = new Asset();
asset.Container = "mycustomnameformycontainer";
string outputAssetName = assetName;
return await client.Assets.CreateOrUpdateAsync(resourceGroupName, accountName, outputAssetName, asset);
}
我有一个类似于 AMSV3Quickstarts 示例的程序,我需要根据我的程序 logic/contract 更改输出资产容器的默认名称。是否可以以某种方式更改输出资产容器名称?
我尝试了什么:
- RTFM
- 更改转换作业名称
- 更改定位器名称
- 更改输出资产名称
但是,在我的 blob 存储中,它仍然是 asset-{GUID}
格式。
使用 REST API 创建资产时,您可以设置容器名称:
https://management.azure.com/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Media/mediaServices/:accountName/assets/:assetName?api-version={{api-version}}
{
"properties": {
"description": "A documentary showing the ascent of Mount Logan",
"alternateId": "(Optional) some GUID",
"storageAccountName": "(Optional) someStorageAccount",
"container": "(Optional) custom container name if you want"
}
}
使用 .NET SDK 时,资产模型包含相同的参数: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.media.models.asset?view=azure-dotnet
感谢您的快速回答!你是对的,工作很有魅力。非常感谢您的回答。
对于未来的我(和其他人),这是工作代码:
private static async Task<Asset> CreateOutputAssetAsync(IAzureMediaServicesClient client, string resourceGroupName, string accountName, string assetName)
{
Asset asset = new Asset();
asset.Container = "mycustomnameformycontainer";
string outputAssetName = assetName;
return await client.Assets.CreateOrUpdateAsync(resourceGroupName, accountName, outputAssetName, asset);
}