In a Business Central cloud environment, you can create a Scheduled Task from a web service client that uses OAuth (S2S). This has also always been possible onprem with a web service client that uses basic auth.
However, this does not work when using a web service client with OAuth2 in an onprem environment. In these clients, TaskScheduler.CanCreateTask() will return true. A scheduled task will also be created. But it will never actually run. Instead it will throw some sort of license error in the event log. One might expect this to be a bug, but Microsoft assured us that this is by design. Onprem environments do not fully support OAuth2. At least, not if you want to employ scheduled tasks.
Some business scenario's may use a web service client to execute business logic that does depend on scheduled tasks. In these cases, onprem environments will have to use basic auth. This makes transition to the cloud for these environments quite a bit harder. Moreover, OAuth2 is superior to basic auth in terms of security. It is not just of added value in a cloud environment.
Therefore, we would like to suggest that Microsoft also adds support for execution of scheduled tasks with an OAuth2 web service client in an onprem environment.
Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team