Hello ,
the issue you are facing can be related to different issues, your app service may be timout or restarts,try to scale up or out your app service and test again .
maybe also there is some exceptions that you are not seeing for that you may need to enable :
1-loging and monitoring : https://learn.microsoft.com/en-us/azure/app-service/monitor-app-service?wt.mc_id=MVP_328341
2- env configuration
3- Permissions
By the way,app services are not designed to run long-runing background processes , you may want to look to
1- Azure functions with time trigger :https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=python-v2%2Cisolated-process%2Cnodejs-v4&pivots=programming-language-csharp?wt.mc_id=MVP_328341
2- WebJobs : https://learn.microsoft.com/en-us/azure/app-service/webjobs-create?wt.mc_id=MVP_328341&tabs=windowscode
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.