Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No route registered for '/api/continuouswebjobs/WebJobsName/run'

Main Issue:

"No route registered for '/api/continuouswebjobs/WebJobName/run'" or /stop or /start but that is what is offered on the Azure portal under the webhook copy to clip board button if you are under a webjob menu under your webjob app container.

Additionally if I try: /api/site/wwwroot/app_data/jobs/continuous/WebJobName/run it gives the same error.

So in short: How do I force a register of the route?

Secondary Issue: BTW: Not sure if you are aware but "Publish as Azure Webjob" in VS2015 AND VS2017 doesnt work anymore. I have to zip up the bin directory and push a manual zip upload from the App Service Container for my WebJob. Very time consuming!

HALP! Any 411 would be much appreciated.

Thanks, -Vandy

like image 957
Matt Vandergrift Avatar asked Jan 29 '23 19:01

Matt Vandergrift


2 Answers

"No route registered for '/api/continuouswebjobs/WebJobName/run'"

It seems that you'd like to manage Azure WebJobs programmatically using WebJobs API, please make sure your request method is POST when you start/stop a continuous job.

start a continuous job

enter image description here

No route registered for '/api/continuouswebjobs/{job name}/start'

enter image description here

"Publish as Azure Webjob" in VS2015 AND VS2017 doesnt work anymore.

I'm using VS2015 with Azure SDK 2.9, I can publish project as Azure Webjob fine on my side, you can try to repair or reinstall Visual Studio and upgrade your Azure SDK.

like image 152
Fei Han Avatar answered Feb 02 '23 08:02

Fei Han


I have faced similar issue in the past using VS 2017 (Community Edition) & today while going through this post, just replicated above scenario & able to make '/start' - Webhook API method to work but you have mentioned '/start' also fail. Can you try below URL update in scheduler & confirm.

In Azure Web Portal, In Azure-> Web Jobs--> Properties --> If 'Web Hooks' URL is copied, it will be having '/run' but when we try to POST to '/run', will get 'No route Registered Error' in HTTP Trace Log, since there is no corresponding POST Method updated in TimerJob or Default API Methods.

enter image description here

But, When your Web Job is enabled(Continuous or Triggered) & in SCheduler (Azure Portal --> Scheduler-->'Custom Job Name'-->Action Settings (Https, POST, Webhooks URL as '/start' instead of '/run' copied from Webjob Properties has worked for me.

enter image description here

By Default, Web Hooks API '/start' is assigned to Default Console Jobs entry Methods(Say - main() in case of C# Console Apps).

PFB Scheduler Completed Azure Log - History' post URL update:

enter image description here

Hope this might help someone!

NOTE: WebHooks API Flow will helps us to understand more.

like image 45
Karthikeyan Baskaran Avatar answered Feb 02 '23 10:02

Karthikeyan Baskaran