我的应用程序将调用 ahttp trigger来读取 blob 文件。当文件大小很小(大约 30MB)时,我能够收到来自 http 触发器的响应。当文件大小约为 160MB 时,我的应用程序收到空响应。仅当 Http 触发器部署在 azure 环境中时才会面临此问题。当从我的本地计算机运行 http 触发器并在我的应用程序中调用本地 http 触发器时,它工作正常。呼叫应用程序string WebAddress = "https://MyfunctionApp.azurewebsites.net/api/Report";//string WebAddress = "http://localhost:7071/api/FIComparisonReport";string WebServiceUri = string.Format("{0}?groupcode={1}&domicile={2}&legalstructure={3}", WebAddress, Uri.EscapeDataString(groupCode), Uri.EscapeDataString(domicile), Uri.EscapeDataString(legalStructure));WebRequest request = WebRequest.Create(WebServiceUri);request.Method = "GET";request.Timeout = 360000;WebResponse response = request.GetResponse();var encoding = Encoding.UTF8;string responseText = "";using (var reader = new System.IO.StreamReader(response.GetResponseStream(), encoding)){ responseText = reader.ReadToEnd(); // empty for large files}HTTP触发public static async Task<HttpResponseMessage> Run( [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestMessage req, ILogger log) {//read blob to stream MemoryStream resultSets = myfunc(); var response = new HttpResponseMessage(HttpStatusCode.OK) { Content = new ByteArrayContent(resultSets.GetBuffer()) };response.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");return response;我在这里缺少什么?
1 回答
aluckdog
TA贡献1847条经验 获得超7个赞
响应大小限制为最大 100 MB。
运行时限制刚刚提高到 100MB。
https://github.com/Azure/azure-functions-host/issues/1063#issuecomment-288818131
这里讨论的是 HTTP 请求,但我相信响应也有同样的限制。
- 1 回答
- 0 关注
- 118 浏览
添加回答
举报
0/150
提交
取消