Post a large file for analysis by an Azure Durable Function

35 views Asked by At

My Orchestration function will use the fan-out, fan-in pattern to parallelise evaluation of a 70MB file. First I followed the tutorial and got the Hello Sequence function app working.

Here is the code for the template’s Client function HttpStart:

const df = require("durable-functions");

module.exports = async function (context, req) {
    const client = df.getClient(context);
    const instanceId = await client.startNew(req.params.functionName, undefined, req.body);

    context.log(`Started orchestration with ID = '${instanceId}'.`);

    return client.createCheckStatusResponse(context.bindingData.req, instanceId);
};

My aim is to adapt this to receive the 70MB file and pass it the Orchestration function.

First step was to include the 70MB file in the POST request. I made no change to the HttpStart function code.

I expected the same result as before.

Instead the response was a 500 Server Error.

The function log shows "FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory". The log doesn’t show the "Started orchestration…" message. I infer the memory problem ocurred while forming the req object.

An issue raised on the Azure forums complains that Msft arbitrarily limits file uploads to 100MB, which suggests my 70MB file could be received.

Question How can the template be modified to accept the POSTed file and pass it to the Orchestration function?

0

There are 0 answers