Recently I have been working with WebJobs and one common issue while deploying these is getting a Pending Restart status on the Azure Portal.
Pending Restart basically means there was an error/exception while Azure tried to run your Job.
First of all check your Webjob logs and see the exception being thrown:
Now go back and check for the code you have written in your WebJob and see if something needs to be fixed.
Issue for me was related to configuration. There are 3 important configuration settings you need in your webjob config file:
- ServiceBus Connectionstring (Connectionstribf to your ASB namespace)
- AzureWebJobsDashboard (This would come from Azure storage A/C you want to use to store the logs from the job)
- AzureWebJobsStorage (same as above)
Webjobs are a great way to do background processing/ supporting async operations/ reading or writing to Queues and should be leveraged whenever there’s a use case for them.