[BUG] and maybe [Enhancement] Complex objects in local.settings.json Values cause issues and unrelated logs
- Dominant language
- PowerShell
- Stars
- 1.1k
- Forks
- 215
- Avg merge
- 4h 2m
- Merged PRs (30d)
- 1
Description
# Issue Transfer
This issue has been transferred from the Azure SDK for .NET repository, [#22948](https://github.com/Azure/azure-sdk-for-net/issues/22948).
### Please be aware that @MhAllan is the author of the original issue and include them for any questions or responses.
# Details
I want to access configurations in AF the same way I do in Asp.Net Core, by that I mean I want to code it like this
```csharp
var myConfig = Configuration["MyKey"]
```
And I don't want this
```csharp
var myConfig = Configuration["Values:MyKey"]
```
The reason is that I want to have the code ready to transform to Asp.Net Core server instead of Http Functions if I change my mind about cost or performance and I don't want to change the way people used to write configurations in AF or AspNet Core
Now that works fine as long as there is no complex objects in the json file, so this is fine
```json
{
"IsEncrypted": false,
"Values": {
"MyKey": "MyVal"
}
}
```
but once I introduce complex objects (or say sections) in the config like this
```json
{
"IsEncrypted": false,
"Values": {
"MyKey": "MyVal",
"MySection": {
"MySectionKey": "MySectionVal"
}
}
}
```
Two problems will happen
1. Accessing configuration without full path will return nulls, I have to use `Confgiuration["Values:Mykey" ]` for all configurations even the configuration I am asking is not complex object
2. Weird and totally unrelated logs on the output (took me ages to figure out what happened)
```txt
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Azure Functions Core Tools
Core Tools Version: 3.0.3442 Commit hash: 6bfab24b2743f8421475d996402c398d2fe4a9e0 (64-bit)
Function Runtime Version: 3.0.15417.0
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
Can't determine project language from files. Please use one of [--csharp, --javascript, --typescript, --java, --python, --powershell, --custom]
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.