Please note that this approach requires Django to be installed in your environment. If you’re not already using Django, you might need to adjust your project setup accordingly. Also, keep in mind that Azure Functions are stateless, so if you’re planning to stream large amounts of data, you might need to consider other approaches or services that are better suited for that purpose. Lastly, it’s worth noting that as of the time of the search, streaming data from Azure Functions was only officially supported in C#2. The Python solution provided here is a workaround and might not work in all scenarios. Always test thoroughly and consider the limitations of your chosen approach.
How to stream data back to frontend from Azure Functions App?
Hello. I am using an Azure Functions App, and I am open to using an Azure Durable Functions App if necessary. I have a frontend, which is a Microsoft Teams App. Instead of using the usual HTTP request and response, I want to stream data from my Azure Functions App to my Teams app. I am having trouble finding out how to do that. Some resources online say that Azure Functions Apps cannot handle streaming, is that the same with Durable Functions Apps? I would like to use Server Side Events for streaming. Thank you for your help.
2 answers
Sort by: Most helpful
-
-
Mike Urnun 9,836 Reputation points Microsoft Employee
2024-01-17T18:28:38.2+00:00 Hello @Tyler Suard - Thanks for confirming that you're using Linux/Python. As of today, HTTP streaming response is yet to be supported in the Python Functions. Azure Functions team is actively working on this support, and you may track the following GitHub discussion for any updates on the matter: HTTP streaming response support for Azure functions #1349
related threads:
- https://learn.microsoft.com/en-us/answers/questions/1402873/azure-function-streaming-response
- https://learn.microsoft.com/en-us/answers/questions/1401268/azure-functions-with-fastapi-and-openai-streaming
Please "Accept Answer" if the answer is helpful so that others in the community may benefit from your experience.