Skip to content

Conversation

@MakerDev
Copy link

Proposal for fixing #40911.

The original problem was that loading a key-value pair ["TEST__TEST1__TEST2" : "42"] with prefix "TEST_"results in null because after Normalizing the Key "TEST_TEST1_TEST2" , it becomes "TEST:TEST1:TEST2" so the key no longer starts with intended prefix "TEST__".

As this problem occured because NormalizeKey is executed without any consideration of local variable _prefix which is provided via constructor. I changed AzureEnvToAppEnv to check if the prefix ends with "__" before Normalizing.

Now loading ["TEST__TEST1__TEST2" : "42"] with prefix "TEST_"_ results in env["TEST1:TEST2] == "42".

@Dotnet-GitSync-Bot
Copy link
Collaborator

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@dnfadmin
Copy link

dnfadmin commented Aug 20, 2020

CLA assistant check
All CLA requirements met.

@ghost
Copy link

ghost commented Aug 21, 2020

Tagging subscribers to this area: @maryamariyan
See info in area-owners.md if you want to be subscribed.

@Emzi0767
Copy link
Contributor

Emzi0767 commented Sep 2, 2020

This PR doesn't fully resolve this issue as far as I can tell. Try a prefix of TEST__TEST__.

@Emzi0767
Copy link
Contributor

Emzi0767 commented Sep 2, 2020

As an addendum: the fix should reverse the operation order, i.e. prefix stripping should occur before normalisation.

@MakerDev
Copy link
Author

MakerDev commented Sep 5, 2020

As an addendum: the fix should reverse the operation order, i.e. prefix stripping should occur before normalisation.

Thank you for reviewing! I'll try to improve this and fully resolve the issue.

@maryamariyan
Copy link
Contributor

closing in favor of PR #42932

@ghost ghost locked as resolved and limited conversation to collaborators Dec 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants