Search code examples
azurevisual-studio-2017azure-functions

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


I'm developing an 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 I receive 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 was working before I rebuilt the solution, and if I try func azure functionapp fetch-app-settings <functionAppName> then it tries to retrieve the information from the Azure Portal itself.


Solution

  • 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