我的任务是创建 API Azure 函数以将文件上传到 Blob 存储容器。文件采用base64格式,通过POST方法传递给函数,函数体内部采用json格式,其中包含更多需要上传的重要参数。
简单的工作流程是:
但是当我尝试上传大于 4 Mb 的文件时,出现此错误:
Exception: System.AggregateException: One or more errors occurred. (Status(StatusCode="ResourceExhausted", Detail="Received message larger than max (5876735 vs. 4194304)"))
[2023-07-10T12:41:01.044Z] ---> Grpc.Core.RpcException: Status(StatusCode="ResourceExhausted", Detail="Received message larger than max (5876735 vs. 4194304)")
[2023-07-10T12:41:01.046Z] at Microsoft.DurableTask.Client.Grpc.GrpcDurableTaskClient.ScheduleNewOrchestrationInstanceAsync(TaskName orchestratorName, Object input, StartOrchestrationOptions options, CancellationToken cancellation)
更具体地说,这是处理大文件时失败的代码部分:
// Function input comes from the request content.
StartOrchestrationOptions options = new StartOrchestrationOptions {InstanceId = CorreliationId};
instanceId = await client.ScheduleNewOrchestrationInstanceAsync(nameof(UploadFileOrchestrator), requestBody, options);
requestBody是json,里面有文件,所以它是InstanceInput。错误告诉我,Input 数据不能大于 4 Mb。我怎样才能绕过这个问题并增加最大input大小?
我无法找到任何有关orchestrator输入大小的文档。