Run Heroku CLI Command in Heroku Scheduler

48 Views Asked by At

I have deployed .NET console as a container in Heroku. I want to run this console app daily so I need to use Heroku Scheduler. I can run my application using Heroku CLI heroku run bash --type=worker --app serene-mountain-60523. But when the same command is added in the Heroku Scheduler Job it does not work. I have added an authentication key in the config vars of the Heroku app. I have tried adding a job with a command like bash --type=worker --app serene-mountain-60523 as well.

1

There are 1 best solutions below

0
Dhanik Lal Sahni On

I could schedule a job with the command 'dotnet <app>.dll'. the app is the name of the DLL that was put in the docker file as an entry point.

ENTRYPOINT ["dotnet", "DataSyncService.dll"]

So with this entry code, I have put dotnet DataSyncService.dll in Heroku Scheduler. Ensure you have enabled at least one dyno in the resources tab. Otherwise scheduler will not work.