@Luna Thanks for asking question! Could you please go to Diagnose and Solve Problems and look for a restart detector.
This tool can help you find out the possible causes of restarts.
For details refer to- Azure App Service diagnostics overview
Also, can you verify if you have enabled Auto-Heal rules? These rules will trigger a full restart, which will affect processes such as Application Initialization.
See- https://azure.github.io/AppService/2021/04/21/Announcing-Autoheal-for-Azure-App-Service-Linux.html
Please let us know.