问题
Often when I republish a webjob with some minor changed and try to Rerun a Webjob function SCM shows me the following warning in the web portal, and I cannot execute the function
Host is not running; requests will be queued but not execute until the host is started.
The host is always running in this case, and the job is setup as singleton, there should not be a problem with multiple hosts.
回答1:
The WebJobs Dashboard shows this message until it receives an updated "heartbeat" message from the host indicating that the host is running. The JobHost writes the heartbeat message into blob storage (in the azure-webjobs-hosts container under path /heartbeats). The Dashboard polls the heartbeat blob for a particular host ID and shows this message when it detects the host hasn't started running yet. There might be a minimal delay between when the host starts up and when the Dashboard sees the blob update.
回答2:
For me it was not a heartbeat issue or a HostId naming change. My WebJobs were running properly in continuous mode, but could not run them individually. This happened after updating the version in AssemblyInfo.cs.
To resolve/workaround:
- Download Azure Storage Explorer
- On your App Service, copy the connection strings from
AzureWebJobsStorage
andAzureWebJobsDashboard
- Stop your WebJobs
- Connect to the web jobs storage accounts in Azure Storage Explorer
Delete these containers and queues:
Containers
azure-jobs-host-archive
azure-jobs-host-output
azure-webjobs-dashboard
azure-webjobs-hosts
Queues
azure-webjobs-*
- Other queues that are for your web jobs if you used custom hostids
- Start WebJobs
来源:https://stackoverflow.com/questions/34402114/host-is-not-running-requests-will-be-queued-but-not-execute-until-the-host-is-s