I’ve pulled in our development project and other developers have no issue.
I am running Azure Storage Emulation.
In my case, when I run it, I get a 404 error saying can’t find the container.
Drilling into it, the container is ‘azure-webjobs-hosts’, and googling this shows this to be a standard container name, that stores webjob information.
I cannot find how this is first created though, and the code I have pulled in, which is based on a default new project, does not appear to create it.
I would like to how ‘azure-webjobs-hosts’ container is usually created, as I can’t find anything online. Perhaps I need to install some kind of tool, library or SDK?
I would assume it is supposed to be created automatically if it is missing, but it would appear that I’ve missed a step somehow.
If I manually create the container, it then complains about a missing blob, and rather than try to patch this together myself I thought it would be better if I found out the root issue and resolved it.
Any suggestions?
2
Answers
I've solved this problem and it was very simple. I had break on all exceptions turned on.
For some reason they decided that even though having no container is expected the first time, they would throw an exception. This exception is rethrown a few times, and eventually handled by something that creates the container.
IMO this is bad design, considering the program expects there to be no container the first time you run it and will create it if needed, it shouldn't be an exception.
Anyway, this was the reason. Hammering F5 or setting your exception settings to default so it doesn't catch runtime errors will fix the problem.
As per my experience,
Azure Web Jobs SDK isa NuGet Package and can be installed through the cmdlets given in the Official Site.
Yes, it would be created/added automatically as a namespace, Package References when the Azure Functions is created as this package is linked with Storage account and essential to store the data i.e., processing in the background. You can get more info about the usage of it from the GitHub Official Article of Azure Web Jobs SDK Integration.
In Local System:
azure-webjobs-hosts
is a folder created in the blob container locally as soon as this storage account is used by any application moves to running state.A Folder named
Locks
will be created inside theazure-webjobs-hosts
container/folder.timers
folder also created during the Timer Trigger Function run and the log files also created with the block blob type inside the locks folder and also timers folder.Few more folder created in the blob container automatically based on type of trigger/application integrated with Azure Web Jobs SDK. Those folders are part of that local storage account, can be deleted manually and can also be recreated when the application starts running.
In Azure Portal (cloud):
When you create the Azure Function App in the Portal, Storage account is required. After Creation, Functions will be in running state so the containers such as
azure-webjobs-hosts
,azure-webjobs-secrets
can be created that stores some data such ashost.json
file (that contains Authorization keys), available inazure-webjobs-secrets
.You can also host multiple function apps to the same storage account so a folder can be created and named with Function App Name inside the containers to show the logs related to that specific Application.
After publishing the local function project (.Net 6) having Http & Timer Triggers from VS2022 IDE to Azure Portal function app, below folder can be created in the associated Storage Account Container:
These are the functionalities of the
azure-webjobs-hosts
and Azure Web Jobs SDK in an Azure Function App and more information on its usage can be given in the above mentioned references.