Reputation: 642
I am wondering if there are any solutions for a 'Control Panel' like functionality for Azure Webjobs? We have a webapp that has a few different webjobs. For example, we have a daily 'db cleanup' method as well as one that sends out billing notifications. We also have methods that pull in data from various 3rd party systems every 5 minutes. All in all, about a dozen different little jobs here and there. Most are triggered using a CRON timer trigger.
I would like to have some sort of 'dashboard/Control Panel' where I can quickly see all the functions within all the webjobs (although I could easily move all the functions to 1 webjob). It would show last run time, last run status, next run time, and have the ability to 'pause' a function from running (as well as resume). I know I can do all this by literally stopping the entire WebJob in Azure but then it ends up stopping other functions that I may not want to. I also don't want to have 20 webjobs each with 1 function. Any solutions that have been developed? Is there a Dashboard that works like that with Azure Functions?
Thanks!
Upvotes: 0
Views: 371
Reputation: 14324
Firstly you don't have to have all functions in one Functions.cs file, you could have multiple multiple webjobs and in one webjob there could be multiple function files(Functions.cs, Function1.cs etc).
Then for now if you have a bunch of functions in one webjob, you could only manage one whole webjob. If your webjob is continuous, you could stop it in the portal or kill the process in the kudu. Then your webjob will be in stopped or pending restart status.
If you still want to manage each one function in one webjob, suppose you have to try the Azure Function.
Upvotes: 1
Reputation: 19598
As part of project Kudu - Kudu is the engine behind git/hg deployments, WebJobs, and various other features in Azure Web Sites, there is a web jobs API available. You can get more details from here - WebJobs API Wiki.
You can get details of all Web Jobs using - GET /api/webjobs
method, the response contains the status of the webjobs. I am using PowerShell to Monitor my web jobs. Here is some psuedo code which will help you to get started.
$authHeader = "Basic 3946239864237492789f9df987d7f7s97f987s8d977sd978979f8s77f9797w9e7987e="
$fullAuthHeader = @{
Authorization = $authHeader
}
$response = Invoke-WebRequest -Uri https://yoursite.scm.azurewebsites.net/api/triggeredwebjobs/$schedulerEntry -Headers $fullAuthHeader -Method GET -UseBasicParsing
$output = $response.Content | ConvertFrom-Json
The $output
is a Json object, you can loop through and get details.
Upvotes: 0
Reputation: 19484
Yes Azure has Control panel for webjobs.
Open url https://YOUR_APP_NAME.scm.azurewebsites.net/ -> Tools -> Web Jobs dashboard
Or Open your app -> In menu search advanced tools
Upvotes: 1