Response streaming does not work with SWA API function
- Dominant language
- No language data
- Stars
- 346
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
If I write an API function in SWA that returns a ReadableStream, it does not [stream the response](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-node?tabs=javascript%2Cwindows%2Cazure-cli&pivots=nodejs-model-v4#http-streams) - it arrives all at once.
This appears to be SWA-specific (and possibly managed function specific?), since if I take _the exact same function_ and deploy it separately, it does stream the response.
**To Reproduce**
Reproduction repo: https://github.com/geoffrich/azure-streaming-repro-swa
Demo sites:
- [with SWA](https://blue-grass-02408bd1e.6.azurestaticapps.net/api/streamTest), does not stream response
- [standalone Node Azure function](https://streaming-repro.azurewebsites.net/api/streamtest), does stream response
**Expected behavior**
Azure function response is streamed in instead of all-at-once.
This may be an intentional limitation of SWA managed functions - if so, it should [be documented](https://learn.microsoft.com/en-us/azure/static-web-apps/apis-functions).
**Device info (if applicable):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Additional context**
https://github.com/Azure/static-web-apps/issues/1180 possibly related, though that thread is quite long and about a C# Azure function.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.