#SharePointProblems | Koskila.net

Solutions are worthless unless shared! Antti K. Koskela's Personal Professional Blog
>

"Missing value for AzureWebJobsStorage in local.settings.json" when debugging Azure Functions locally?

β€’ koskila
Reading Time 4 min
Word Count 625 words
Comments 5 comments
Rating 4.7 (14 votes)
View

Another day, another issue with Azure Functions! For such a simple and powerful tool, it sure does produce a lot of topics for blog articles! 😁 So, in this article, I'm explaining a couple of possible reasons why you might get an error along the lines of "Missing value for AzureWebJobsStorage" when debugging Azure Functions locally.

But before jumping into the solution(s), let's take a closer look at the issue at hand, shall we?

AI-powered summary: Streamlining Azure Functions Debugging

Encountering β€˜Missing value for AzureWebJobsStorage’ during local Azure Functions debugging? This article outlines solutions to resolve it. The AzureWebJobsStorage property is essential for non-httptrigger functions, storing keys, managing timers, and handling Event Hubs checkpoints. To fix, ensure your local.settings.json contains β€˜UseDevelopmentStorage=true’ to utilize local Azure Storage Explorer or Azurite. Start with the simplest solution and progress as needed for successful local runtime execution.

Problem

When firing up your Azure Functions project locally, your project fails to run.

Instead, 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.

I've also seen this, longer version pop up (might depend on your version of Azure Functions runtime):

Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than httptrigger, kafkatrigger, rabbitmqtrigger, orchestrationtrigger, activitytrigger, entitytrigger. You can run 'func azure functionapp fetch-app-settings <functionappname>', specify a connection string in local.settings.json, or use managed identity to authenticate.

But... You might actually have that property in the file - so what's the error about, then? Let's take a look!

What is "AzureWebJobsStorage" property used for?

The Azure Functions runtime uses this storage account connection string for its normal operation. Some uses of this storage account include key management, timer trigger management, and Event Hubs checkpoints. The storage account in question must be a general-purpose one that supports blobs, queues, and tables.

However - when running the runtime locally, this property in your local.settings.json file under "Values" should usually contain "UseDevelopmentStorage=true", in which case the runtime should use your Azure Storage Explorer or Azurite locally.

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.

4 ways to fix "Missing value for AzureWebJobsStorage in local.settings.json"!

  1. First things first - 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:
    This image has an empty alt attribute; its file name is image-10.png

    And in copy-pasteable form - this is what you should add to local.settings.json -file's "Values"-node:
    "AzureWebJobsStorage": "UseDevelopmentStorage=true"

    Simple as that! Except if it doesn't work, try the other options below.

  2. Close and reopen your Visual Studio instance

    Just in case - it's worth trying out.

    It's easy, it's quick, and it has helped me once or twice!

  3. No nested values in local.settings.json

    Valid JSON can have values nested infinitely deep. But your local.settings.json file does not support that (beyond predefined "sections", such as "Values" (for app settings) or "ConnectionStrings", however!

    Verify you're not trying anything too fancy there.

    What's a bit confusing, however, is that the appsettings.json file DOES support nested configuration values. So no consistency here. 😊

  4. 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 recent versions of Visual Studio, but YMMV. 😌


And at this point, you should be good!

Did it work for you? Am I missing something? Let me know in the comments section below!

References

Comments

Interactive comments not implemented yet. Showing legacy comments migrated from WordPress.
Yuri
2022-06-05 16:30:34)
This line saved me :) : "Verify you’re not trying anything too fancy there." Slava Ukraini!
2022-06-11 20:55:22
Hey, sometimes it's the simple things, right? πŸ˜… Heroyam slava!
Sanmuga Nathan
2022-06-06 20:32:06)
Thanks mate. You are a life saver. I was trying with Az Fn V4 and missed local.setting.json config in .csproj. After adding it, I am able to debug locally.
2022-06-11 21:34:17
Thanks for your comment, mate - happy to hear it was helpful!
2022-06-28 19:00:44
Thanks for the kind comment, mate! Happy to hear it helped :)