gpt4 book ai didi

Azure 媒体服务 CreateWithHttpMessagesAsync - 操作返回无效状态代码 : "BadRequest" -

转载 作者:行者123 更新时间:2023-12-02 07:36:30 26 4
gpt4 key购买 nike

我将 Azure Media Services v3Azure Function v3 应用程序结合使用,在尝试从 https url 创建新作业时遇到问题。

我在提交作业的 Azure Function 中有以下方法。

private static async Task<Job> SubmitJobAsync(IAzureMediaServicesClient client, string transformNam, string jobName, string fileUrl) {
JobInputHttp jobInput = new JobInputHttp(files: new [] { fileUrl });
JobOutput[] jobOutputs =
{
new JobOutputAsset(jobName)
}

Job job = await client.Jobs.CreateAsync(
_resourceGroupName,
_accountName,
transformName,
jobName,
new Job
{
Input = jobInput,
Outputs = jobOutputs
},
CancellationToken.None);

return job;
}

实际创建作业的线路失败 await client.Jobs.CreateAsync(...并返回异常,并显示以下消息:

Operation returned an invalid status code 'BadRequest'

堆栈跟踪:

at Microsoft.Azure.Management.Media.JobsOperations.CreateWithHttpMessagesAsync(String resourceGroupName, String accountName, String transformName, String jobName, Job parameters, Dictionary`2 customHeaders, CancellationToken cancellationToken) at Microsoft.Azure.Management.Media.JobsOperationsExtensions.CreateAsync(IJobsOperations operations, String resourceGroupName, String accountName, String transformName, String jobName, Job parameters, CancellationToken cancellationToken)

知道这意味着什么或者我如何进一步调试它吗?

最佳答案

我认为问题在于您在创建作业之前没有创建输出资源。尝试在创建作业之前添加这些行:

string outputAssetName = jobName;

Asset outputAsset = await client.Assets.CreateOrUpdateAsync(_resourceGroupName, _accountName, outputAssetName, new Asset());

JobOutput[] jobOutputs =
{
new JobOutputAsset(outputAssetName)
}

另请参阅: https://github.com/Azure-Samples/media-services-v3-dotnet-core-functions-integration/blob/master/LiveAndVodDRMOperationsV3/LiveAndVodDRMOperationsV3/VodFunctions/submit-job.cs

关于Azure 媒体服务 CreateWithHttpMessagesAsync - 操作返回无效状态代码 : "BadRequest" -,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59761803/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com