私は、POSTされたファイルを取り込んで処理するAzure関数の作成に取り組んでいます。基本設定があり、小さなファイルを正常にPOSTできます。大きなファイルをPOSTするたびに、次のエラーメッセージが表示されます。Azure関数のMaxReceivedMessageSizeを設定する方法
A ScriptHost error has occurred
Exception while executing function: Functions.HttpTriggerCSharp. Microsoft.Azure.WebJobs.Host: Exception binding parameter 'request'. System.ServiceModel: The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.
Exception while executing function: Functions.HttpTriggerCSharp
Executed: 'Functions.HttpTriggerCSharp' (Failed)
Function had errors. See Azure WebJobs SDK dashboard for details. Instance ID is '5fc0eaa2-0159-4185-93e4-57a4b2d4bb7f'
このプロパティを設定する場所に関するAzure関数のドキュメントは見つかりませんでした。 Azure関数の最大メッセージサイズを増やすことは可能ですか?
編集
function.json
{
"disabled": false,
"bindings": [
{
"name": "request",
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"methods": [ "GET", "POST" ],
"route": "test"
},
{
"name": "response",
"type": "http",
"direction": "out"
}
]
}
run.csx
using System.Net;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage request, TraceWriter log)
{
log.Info($"C# HTTP trigger function processed a request. RequestUri={request.RequestUri}");
// parse query parameter
string name = request.GetQueryNameValuePairs()
.FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0)
.Value;
return name == null
? request.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
: request.CreateResponse(HttpStatusCode.OK, "Hello " + test.Value);
}
あなたの機能コードとfunction.jsonの外観は分かりますか?これはWCFエラーメッセージのように見えますが、これはHttpTrigger呼び出しからは期待できません。したがって、私はそれを再現し、私たちが手助けできるかどうかを知りたいと思っています。 – brettsam
同様のエラーを追跡するために[issue](https://github.com/Azure/azure-webjobs-sdk-script/issues/1063)を開きました。ここで、またはgithubでコードを共有できれば助かります –
私のfunction.jsonとrun.csxファイルの内容を追加しました。私はこの問題に遭遇したときにAzure関数を実験していたので、それらはボイラープレートから大きく変更されていません。 – jdehlin