'IIS Dotnet 6 Web Api has a HttpRequestException every morning
I have a .Net 6 Web Api that uses the PnP Core Sdk to communicate with a Sharepoint Online Server (365 Cloud). The Web Api is registered in AAD, has Application permissions for the Sharepoint Rest Api / MS Graph and uses a Certificate for authorization. When I run the process as a user it works for several days without issues, but when I deploy it with IIS 10 on Windows Server 2016 Datacenter I get a HttpRequestException every morning and have to manually recycle the application pool or restart the Application. Otherwise it does not work anymore. I have attached the logs for the exception. I am not very familiar with IIS and are not able to resolve the error. Can somebody provide help?

Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
