title: How to receive large response from azure http trigger
body: <p>My application will call a <code>http trigger</code> to read a blob file. </p>
  
  <p>I was able to receive the response from my http trigger when the file size is small (around 30MB). When the file size is around 160MB then my application  is receiving empty response. </p>
  
  <p>Facing this issue is only when the Http trigger is deployed in azure environment. When run the http trigger from my local machine and call local http trigger in my app its working fine. </p>
  
  <p>Calling App </p>
  
  <pre><code>string WebAddress = "https://MyfunctionApp.azurewebsites.net/api/Report";
  //string WebAddress = "http://localhost:7071/api/FIComparisonReport";
  string WebServiceUri = string.Format("{0}?groupcode={1}&amp;domicile={2}&amp;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
  }
  </code></pre>
  
  <p>Http trigger</p>
  
  <pre><code>public static async Task&lt;HttpResponseMessage&gt; 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;
  </code></pre>
  
  <p>What am I missing here ?</p>