@Gadamella, Naresh Thanks for posting your question in Microsoft Q&A, apologize for any inconvenience caused on this.
I understand that your application is hosted on azure app service, correct me if my understanding is wrong.
If yes, Azure app service has default request time out for 240 seconds and if your application takes more than this time it is suggested/recommended to leverage Azure WebJobs for background processing.
Refer to this documentation for more information about Azure WebJobs.
Hope this helps, let me know if you have any further questions on this.