Azure / AppConfiguration-DotnetProvider

The .NET Standard configuration provider for Azure App Configuration
https://github.com/Azure/AppConfiguration
MIT License
84 stars 37 forks source link

Add yaml support #381

Open carlin-q-scott opened 1 year ago

carlin-q-scott commented 1 year ago

I'd like to be able to store application/yaml content in my app config keys and have this library deserialize it.

I found the json key value adaptor in src/Microsoft.Extensions.Configuration.AzureAppConfiguration/JsonKeyValueAdapter.cs. I don't think it would take much work to implement that for yaml. But it would add a dependency on another nuget package.

amerjusupovic commented 1 year ago

Hi @carlin-q-scott , as of now we recommend using the application/json content type and converting yaml data to json format when necessary. Please let us know if you have any questions or issues you feel aren't addressed by this approach.

goldsam commented 4 months ago

The issue is having to convert back and forth between JSON and YAML. azure App Configuration is targeting administrators who enjoy simplicity. YAML is simplicity - there's a reason it's achieved nearly ubiquitous adoption. Sorry to sound snarky, but I feel like this was self-evident in the OP's request and the response seemed very dismissive.

amerjusupovic commented 4 months ago

I never intended to be dismissive of the original question, so I'm sorry if I came across that way. From what I understand, yaml can be converted to json fairly easily so I thought it wouldn't introduce a large hurdle for anyone who wants to parse a yaml file. I wanted to know if anyone's aware of an issue with this, or a use case that I might not have considered, because then I would appreciate them bringing up any issues with my original understanding.

I agree that having YAML parsing could make things a bit easier for some users. The nuget package for parsing yaml that was mentioned does mean we have to add a new dependency, which we usually try to avoid. We didn't think there was a strong enough reason to add this capability, so we recommended the approach that I mentioned. We're of course open to reconsidering this if it's something that people feel strongly about.

goldsam commented 4 months ago

@amerjusupovic You could instead make IKeyValueAdapter a part of the public API to allow parsing extensions. A separate package such as Microsoft.Extensions.Configuration.AzureAppConfiguration.Yaml could be provided to add the request YAML support.

fvidesf commented 1 week ago

@amerjusupovic You could instead make IKeyValueAdapter a part of the public API to allow parsing extensions. A separate package such as Microsoft.Extensions.Configuration.AzureAppConfiguration.Yaml could be provided to add the request YAML support.

And here I was thinking we could do this on my project (implementing our own IKeyValueAdapters). Are there any plans for this? or any workarounds