Azure-docs: Run the function locally: Settings must be of the form "name=value".

Created on 2 May 2019  Â·  14Comments  Â·  Source: MicrosoftDocs/azure-docs

When running the function locally with func host start, the script stops with the following error:

[02-May-19 08:39:58] A host error has occurred
[02-May-19 08:39:58] Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value".
Settings must be of the form "name=value".

I was able to remove the error by undoing the "Reference bindings" step. Basically by letting "host.json" look like:

{
    "version": "2.0"
}

However, this is not according to this guide, so you should probably do something about it.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri1 azure-functionsvc cxp product-issue triaged

Most helpful comment

I encountered this same issue on the template for creating a Python Azure Function triggered by a Service Bus Queue. The initial code generated by func new creates an invalid local.settings.json that results in the following error message when running the function locally via func host start:

[7/9/19 9:46:44 PM] A host error has occurred
[7/9/19 9:46:44 PM] Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value".
Value cannot be null.
Parameter name: provider

I suggest it might be in the best interest of both the users and those in engineering and tech support that have to support this software to generate code that works without modifications when func new is invoked.

Making the changes suggested by @PramodValavala-MSFT resolved this issue for me, but ideally, the initial base project code that's generated should "just work" without modifications.

All 14 comments

@aorsten Thanks for your question. We are checking on this and will respond to you soon.

@aorsten That section requires functions core tools of version 2.6.1071 or higher as mentioned.

Could you confirm if you are using the same?

func version
2.6.1080

I installed it all yesterday, so I suppose I was using the latest.

@aorsten The problem seems to be a missing AzureWebJobsStorage application setting which is really not needed for just a HTTP triggered function. There was an issue raised (and fixed) for this - Azure/azure-functions-core-tools#1256

Note that Extension bundles are a pretty new feature which should be safe to remove for now but they do hope to help when adding different types of functions using the various bindings available.

For local development, you can install Azure Storage Emulator and set your local.settings.json to something like this

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsSecretStorageType": "files"
  }
}

You can find more information about local.settings.json in the docs.

@aorsten Just following up here... Hope my previous comment helps.

Also, upgrading to the latest version (2.7.1149 as of today) should resolve this as well.

That's good. The important thing here is that new users (like I was) don't encounter roadblocks when trying new tech.. :)

@aorsten We totally understand. Sorry about the experience. This configuration is a pretty new feature that was added but guess this particular scenario was overlooked.

We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

I encountered this same issue on the template for creating a Python Azure Function triggered by a Service Bus Queue. The initial code generated by func new creates an invalid local.settings.json that results in the following error message when running the function locally via func host start:

[7/9/19 9:46:44 PM] A host error has occurred
[7/9/19 9:46:44 PM] Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value".
Value cannot be null.
Parameter name: provider

I suggest it might be in the best interest of both the users and those in engineering and tech support that have to support this software to generate code that works without modifications when func new is invoked.

Making the changes suggested by @PramodValavala-MSFT resolved this issue for me, but ideally, the initial base project code that's generated should "just work" without modifications.

@aorsten The local.settings.json file is generated by the func init command in fact and looking at the code, looks like the config should be set when running on Windows (since the Azure Storage Emulator is supported only on Windows) but in my case, I was running it in WSL and seems like func doesn't detect for that today. Could you confirm if you are using WSL too?

I was running into same error using same scenario and can confirm that's an issue with WSL.

For reference, I'm on the latest MacOS, so this problem could apply generically to all *nix environments if WSL is also not working for people.

I was running into same error using same scenario

I met the same error with dotnet environment. Did this issue has been fixed?

The Azure Storage Emulator is only supported for Windows (and is accessible from WSL), so this setting doesn't apply for Mac or Linux.

That being said, there is another cross platform (nodejs based) emulator, azurite, that can be used as well and requires the same setting, but this isn't officially supported by func yet - Azure/azure-functions-core-tools#1200

With the little testing (queue and timer) that I've done, it does seem to work. Just note that you have to use v2 since v3 just supports Blob storage as of now. You can install it with this command

npm install -g azurite@2

Also, note that is repo for the docs and I believe it would be best to open an issue to discuss this further on the functions core tools repo instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

varma31 picture varma31  Â·  3Comments