Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppress Warning "cannot find value named '{0}' in local.settings.json #519

Open
qualitas-software opened this issue Jun 8, 2021 · 6 comments

Comments

@qualitas-software
Copy link

I exclude local.settings.json from checkin as developers can configure some aspects separately as needed.

I have a storage connection string for a queue trigger which I default (ie- set as a convention) in Startup. When deployed, this will be filled from a keyvault, but in dev the default is UseDevelopmentStorage=true.

This all works, but I get an unwanted warning telling me I must set the value in local.settings.json, as follows:

Function [MyListener]: cannot find the value named 'MyStorage:ConnectionString' in local.settings.json that matches 'connection' property set of 'QueueTrigger'

I would like to add a code suppression for this warning. Is this possible ?

@fowl2
Copy link

fowl2 commented Feb 2, 2022

This warning appears to be generated here:

_logger.LogWarning($"Function [{functionName}]: cannot find value named '{appSettingName}' in {settingsFileName} that matches '{token.Key}' property set on '{binding["type"]?.ToString()}'");

It also appears erroneously when using the "__" syntax, eg. with service bus with managed identity "connectionName__fullyQualifiedNamespace".


As a workaround, it seems that replacing local.settings.json with properties\launchSettings.json works, eg:

{
  "profiles": {
    "project.name": {
      "commandName": "Project",
      "commandLineArgs": "--csharp",
      "environmentVariables": {
        "AzureWebJobsStorage": "UseDevelopmentStorage=true",
        "FUNCTIONS_WORKER_RUNTIME": "dotnet",
        "connectionName__fullyQualifiedNamespace": "servce-bus-namespace-goes-here"
      }
    }
  }
}

@petrkoutnycz
Copy link

I'm having this issue as well, not even adding an env variable to `launchSettings' helps. Any news regarding this bug?

@jameswoodley
Copy link

jameswoodley commented Jan 11, 2023

Same issue here when using the __fullyQualifiedNamespace pattern.

This is at build time, so environment variables don't make a difference

@DanielRNichols
Copy link

Same issue here when using managed identities with the service bus. I had seen a previous issue raised by @petrkoutnycz Azure/azure-sdk-for-net#32840 in which it was marked as resolved, and to update to the latest version of azure core tools; however, that does not seem to be working in my case.

@petrkoutnycz
Copy link

@DanielRNichols I believe it works with the latest version of SDK, at least for me :-)

@michasacuer
Copy link

@petrkoutnycz Which SDK did you update? I go back to my function after couple of months and it stopped working (i didn't do anything in the codebase)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants