The app in this repo streams a large file (96mb by default) named input.txt
to a file output.txt
and logs the progress.
- Version 4.0.5530 of Azure Functions Core Tools
- Node.js v18+
-
Add a
local.settings.json
file with the following contents:{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "", "FUNCTIONS_WORKER_RUNTIME": "node", "FUNCTIONS_REQUEST_BODY_SIZE_LIMIT": "4294967296" } }
-
Run
npm install
. -
Run
npm start
. This will build the app, create the large input file, and start the app. -
Leave the previous terminal running and open a new terminal to execute a function.
- If you want to simulate streaming a request, run
npm run streamRequest
. - If you want to simulate streaming a response, run
npm run streamResponse
.
- If you want to simulate streaming a request, run
-
You should see progress in the console as the file is processed. It happens fast for a 96mb file, but as long as you see a chunk count greater than 1, you know your data was streamed.
src/functions/*
: The actual functions for your appsrc/scripts/*
: Scripts used to create the large file and send requests to Azure Functionssrc/constants.ts
: A file with several settings that you can change to modify the behavior of the app.
- If you want to make it even more fun, change the value of
fileSize
insrc/constants.ts
to a larger value (the max as defined inlocal.settings.json
above is 4 GB). - If you haven't already, read our blog post for this feature.