This post was most recently updated on March 13th, 2021.
2 min read.Another day, another issue with Azure Functions! For such simple and powerful tool, it sure does produce a lot of topics for blog articles! 😁
So let’s get down to fixing another Azure Functions configuration issue. But wait – what WAS the problem again?
Problem
Table of Contents
When firing up your Azure Functions project locally, this error is what you’re confronted with:
"Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than httptrigger, kafkatrigger. You can run 'func azure functionapp fetch-app-settings ' or specify a connection string in local.settings.json."
But… You might actually have that property in the file – what’s the error about, then? Let’s take a look!
Solution
The solution might be one of the following – I’m starting from the most obvious and simple one, which is likely where you should start as well.
Time needed: 10 minutes.
How to fix “Missing value for AzureWebJobsStorage in local.settings.json”?
- Add “AzureWebJobsStorage” value to your local.settings.json file
Obviously, you could be missing this app setting completely – maybe by adding it somewhat like this:
So:"AzureWebJobsStorage": "UseDevelopmentStorage=true"
Simple as that! Except if it doesn’t work, try the other options below. - No nested values in local.settings.json
Valid JSON can have values nested infinitely deep. Your local.settings.json file does not support that (beyond predefined “sections”, such as “Values” (for appsettings) or “ConnectionStrings”, however!
Verify you’re not trying anything too fancy there.
What’s a bit confusing, however, is that appsettings.json file DOES support nested configuration values. So no consistency here. 😊 - Make sure your local.settings.json file is getting deployed (copied) to the output folder
Modify your .csproj file to have this:
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
This applies at least to .NET with Visual Studio, but YMMV. 😌 - Close and reopen your Visual Studio instance
Just in case.
And at this point, you should be good!
References
- https://stackoverflow.com/questions/48907751/missing-value-for-azurewebjobsstorage-in-local-settings-json-local-development-i
- https://github.com/Azure/azure-functions-core-tools/issues/1473
- Experiment: DateTime formats - April 21, 2021
- How to fix “LinkedAuthorizationFailed” when deploying an Azure Logic App? - April 15, 2021
- How to fix a build configuration that’s not available as a build directive in Visual Studio? - April 14, 2021