I'm requesting a durable function (Azure function) from a Power Automate flow. The request includes a ZIP file. If this ZIP file is as large as 20MB, the following happens:
- The flow receives a 503 ServiceUnavailable message almost immediately
- After the time expected for the operation,
the Azure function log shows that the durable function's orchestrator returns the value that indicates success
and the function has indeed created the artefacts it should create.
This doesn't happen with requests as small as 5.5MB. I have not tried to find the 'pain point' in between 5.5 and 20MB.
For comparison, I have included this large ZIP file in a request to a 'plain' Azure function HTTP trigger and did not get a 503 or any other error message.
I can't find anything in the log that indicates at which point in the process the 503 error is returned to the client.
Below is the code of the 'starter' function.
Does anyone know what is the cause of this error, or if it can be prevented?
[FunctionName(nameof(MyDurableClient))]
[Produces("application/json")]
[Consumes("multipart/form-data")]
public async static Task<IActionResult> MyDurableClient(
[HttpTrigger(AuthorizationLevel.Anonymous, "post")]
HttpRequest req,
[DurableClient] IDurableOrchestrationClient starter,
ILogger log)
{
ActionResult result;
try
{
[left out for brevity]
byte[] templateZipFile = null;
IFormFile formFile = req.Form.Files["file"];
if (formFile.Length == 0)
{
throw new ControllerException("Empty template ZIP file");
}
using (var ms = new MemoryStream())
{
formFile.CopyTo(ms);
templateZipFile = ms.ToArray();
}
log.LogInformation("ZIP retrieved from multipart request form.");
string instance = await starter.StartNewAsync<Tuple<Ticket, ProvisionOptions, byte[]>>(nameof(My_Orchestrator), new Tuple<Ticket, ProvisionOptions, byte[]>(ticket, options, templateZipFile));
return AsyncApiController.CreateAcceptedStatusResponse(req, log, instance);
}
catch (Exception ex)
{
log.LogError(ex, ex.Message);
result = new ObjectResult(
new ProblemDetails()
{
Title = ex.Message,
Type = ex.HelpLink,
Detail = ex.ToString()
})
{
StatusCode = StatusCodes.Status400BadRequest
};
}
return result;
}