'Take settings from nested local settings.json in Azure Functions
I have got a local.settings.json like this
{
"IsEncrypted": false,
"ServiceBusSettings": {
"TransformedJson": {
"ConnectionString": "connectionstring2"
},
"ServiceLogs": {
"ConnectionString": "connectionstring3"
}
},
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
}
}
First of all is it acceptable to have nested JSON in Azure Functions Local.settings.json? I have that confusion because in Azure we dont have a json file instead we have environment variables as key val pair. (Please correct I am wrong)
If above json is acceptable, how can I get a specific key from the nested settings
For getting IsEncryped I can just use
bool IsEncryped= configuration.GetValue<bool>("IsEncrypted")
Also in function parameter if I need to use value I can Just use
%IsEncrypted%
In my case if I need to get the connection string under TransformedJson attribute and get its values and also I'd like to use that in my parameter with percentage notation.
Please suggest how can I accomplish that?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
