question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

KeyVaultReferencesManager throws an error when provided a null config item

See original GitHub issue

When KeyVaultReferencesManager attempts to match config items with the Key Vault Reference format it can result in a cryptic error being thrown Key Vault Reference format invalid:

The following is an example from a newly created empty function app

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "test": null
  }
}

On Debug

Azure Functions Core Tools
Core Tools Version:       3.0.4378 Commit hash: N/A  (64-bit)
Function Runtime Version: 3.4.2.0

[2022-03-17T01:43:06.010Z] Found C:\***\NullValueFunction\NullValueFunction.csproj. Using for user secrets file configuration.
Key Vault Reference format invalid:
Press any key to continue....

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
k-krupkacommented, Mar 17, 2022

Just encountered this as well. For me the workaround was to remove all properties which are initialized with null values in appsettings.json, like this line: image When i removed it, it’s all good and at least the function starts,

1reaction
j0hnth0mcommented, Mar 21, 2022

This should have been rolled back for both v4 and v3. The rolled back versions for Core Tools are 4.0.3971 and 3.0.3904.

Try deleting these folders and restarting VS to force it to update:

For v3:

C:\Users\ <user name> \AppData\Local\AzureFunctionsTools\Tags\v3 C:\Users\ <user name> \AppData\Local\AzureFunctionsTools\Releases\3.32.0

For v4:

C:\Users\ <user name> \AppData\Local\AzureFunctionsTools\Tags\v4 C:\Users\ <user name> \AppData\Local\AzureFunctionsTools\Releases\4.11.0

Thanks, that cleared up the problem. Both V3 and V4 function runtimes are working again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix null value error when loading configuration file
Spring Boot throws Caused by: java.lang.IllegalArgumentException: null when auto-configuring a component. I have no null properties in my ...
Read more >
Still having big problems with Object reference not set to an ...
The error means that your code is trying to access/reference an object that is a null valued object that is not there in...
Read more >
Unhandled null value error - Plugin Development
I use terraform-plugin-framework to develop a plugin. I find that when i call func (c Config) Get(ctx context.Context, target interface{}) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found