Hello Akshay Chauhan,
Welcome to the Microsoft Q&A and thank you for posting your questions here.
I understand that your Azure function event hub triggers after delay of about 5-10 seconds and you are seeking what to changes or implement to potentially reduce this delay.
Best practices solution
Based on your explanations, the code and the work you posted. I must commend you for a good work, you have already implemented several optimizations and configurations to reduce the latency in your Azure Functions. However, there are a few additional aspects to consider that might help you further diagnose and potentially reduce the delay.
- Validate the delay source with a simple .NET listener application.
- Fine-tune the host.json configuration further.
- Ensure all resources are in the same region to reduce network latency.
- Log function execution times to identify internal delays.
- Monitor and possibly adjust scaling settings.
- Use Application Insights for detailed diagnostics.
- Ensure sufficient throughput units are allocated for Event Hubs.
By addressing each of these areas, you should be able to diagnose and reduce the latency in your Azure Functions.
Accept Answer
I hope this is helpful! Do not hesitate to let me know if you have any other questions or about to do any of the above.
** Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful ** so that others in the community facing similar issues can easily find the solution.
Best Regards,
Sina Salam