Missing value for AzureWebJobsStorage in local.settings.json local development in Visual Studio 2017

I'm developing a azure function locally, with the Storage Emulator and de Storage Explorer opened.

File tree

File tree

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsDashboard": "UseDevelopmentStorage=true"
  },
  "ConnectionStrings": {
    "PlantaoEntities": {
      "ConnectionString": "CENSORED",
      "ProviderName": "System.Data.EntityClient"
    }
  }
}

But a receives the following message when trying to run the code:

Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than HTTP. You can run 'func azure functionapp fetch-app-settings ' or specify a connection string in local.settings.json

It's was working before a rebuild solution, and if I try func azure functionapp fetch-app-settings <functionAppName> it try to retrieve the information from the azure portal itself.


I was getting the same error when I was running my Azure Function in my Visual Studio 2019.

enter image description here

I had already set the Copy To Output Directory action to Copy always and I was still getting the same error. The issue is that the Azure Function local.settings.json file doesn't support nested json. You can track this issue here.

I was having values in local.settings.json as preceding.

{
  "IsEncrypted": false,
  "Values": {
    "Custom": {
      "Tickets": {
        "Channels": [
          "One",
          "Two"
        ]
      }
    },
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "ServiceBusConnectionString": ""
  }
}

As you can see that there is an extra nested json (Custom) object inside Values, that is the reason why I was getting this error. To fix this, I had to add a new configuration file called configuration.json and add my custom values there.

"Custom": {
      "Tickets": {
        "Channels": [
          "One",
          "Two"
        ]
      }
    }

The fix is to use either the ConfigurationBuilder or read that file using File.ReadAllText. You can also add the entire JSON as a plain string in the local.settings.json instead of a JSON object.

Hope it helps.


The solution was to right-click on local.settings.json, go to properties, change "Copy to Output directory" from "Do not copy" to "Copy always". Now the CLI picks up the settings when running from within Visual Studio 2017.

https://github.com/Azure/azure-functions-core-tools/issues/223#issuecomment-326225219


FYI, you also get this error when the value for "AzureWebJobsStorage" is effectively empty (""). You can set it to e.g. "UseDevelopmentStorage=true" for development.

Be aware, this requires the storage emulator installed locally. See the docs.


Just saw this error on VS2019 and resolved it by reordering the local.settings.json so that the IsEncrypted value was after the "Values"

{
   "Values": {
        "AzureWebJobsStorage": "removed",
      },
   "IsEncrypted": false
}

Same error appears when your local.settings.json file has a json error, e.g. to following commas ,,.