I am writing an Azure function in VS 2017. I need to set up a few custom configuration parameters. I added them in local.settings.json
under Values
.
{ "IsEncrypted":false, "Values" : { "CustomUrl" : "www.google.com", "Keys": { "Value1":"1", "Value2" :"2" } } }
Now, ConfigurationManager.AppSettings["CustomUrl"]
returns null.
I'm using:
Am I missing something?
To find the application settings, see Get started in the Azure portal. The Application settings tab maintains settings that are used by your function app. You must select Show values to see the values in the portal. To add a setting in the portal, select New application setting and add the new key-value pair.
The function. json file defines the function's trigger, bindings, and other configuration settings. Every function has one and only one trigger. The runtime uses this config file to determine the events to monitor and how to pass data into and return data from a function execution.
Environment.GetEnvironmentVariable("key")
I was able to read values from local.settings.json using the above line of code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With