Created
February 6, 2019 18:01
-
-
Save BadgerCode/8b349f04997d7fff49265cd3f6afe763 to your computer and use it in GitHub Desktop.
Loads local.settings.json into environment variables for acceptance testing functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var config = JObject.Parse(File.ReadAllText(Path.Join(Directory.GetCurrentDirectory(), "local.settings.json"))); | |
foreach (var configOption in config["Values"]) | |
{ | |
var option = (JProperty) configOption; | |
var key = option.Name; | |
var value = option.Value.ToString(); | |
Environment.SetEnvironmentVariable(key, value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment