I have create an application in core net that should be a long running application, implemented as BackgroundService
and the project is a Microsoft.NET.Sdk.Worker
. In my worker class I delays my ExecuteAsync
using the following code:
await Task.Delay(Timeout.Infinite, stoppingToken);
When running the code locally (using docker) it works fine, the application is running until I stop it. However, then I start it under Azure Container Apps (the one in preview right now) the delay task cancels the task right away and my container fails to be deployed.
I can't find any documentation on some limitations for this in container apps, and i don't know what to do differently, as it works in normal docker setup.