Answers for "Convert appsettings.json into environment variables"

C#
0

Convert appsettings.json into environment variables

Appsettings.json

{
    "SmtpServer": "smtp.example.com",
    "Logging": [
        {
            "Name": "ToEmail",
            "Level": "Critical",
            "Args": {
                "FromAddress": "[email protected]",
                "ToAddress": "[email protected]"
            }
        },
        {
            "Name": "ToConsole",
            "Level": "Information"
        }
    ]
}

Environment variables

setx SmtpServer=smtp.example.com
setx Logging__0__Name=ToEmail
setx Logging__0__Level=Critical
setx [email protected]
setx [email protected]
setx Logging__1__Name=ToConsole
setx Logging__1__Level=Information
Posted by: Guest on September-10-2021

Code answers related to "Convert appsettings.json into environment variables"

C# Answers by Framework

Browse Popular Code Answers by Language