I have DONTNET code pipeline and I need to substitute variables from appsettings.json file.
Can you please give me an example?
This is part of my json file for dotnet core web app.
"ConnectionStrings": { "Redis": "" },
Thank you.
Hello rajputj3@bv.com ,
thank you for reaching out to the Community!
The way and syntax used to reference an environment variable very depends on the language/tools you are using, and not the the pipeline itself.
When you create an environment variable in your repository/workspace, this variable will be available to be referenced by any process during your build step, but the way and syntax used to reference variables is up to the language/tool you're using.
With that in mind, I'm not really familiar with the DotNet core variable syntax, but I found the following article that may help you with the variable substitution on the appsettings.json :
In case that doesn't help, I would suggest reaching out directly to the DotNet community for additional suggestions on how the variable substitution works in that language/framework.
Thank you, rajputj3@bv.com !
Patrik S
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.