VS2019 Docker ASP Core Environment Vars

Tip

If you are debugging with VS2017/9 and want to pass environment variables to your container then read this post, if you are looking for picture of cats then sorry but leave a comment how you got here

 

Step 1

Create a new text file, the name doesn’t matter, but i called mine Dockerfile.env

image
image

 

Step 2

Add this file to your .csproj file.

image

Step 3

Not really a step but you you can simply query your Environment variable in the usual fashion (Environment.GetEnvironmentVariable())

image

 

Note:

Needless to say when you run in production you’ll need to pass the Environment variable according to Docker documentation which I don’t cover here

Comments are closed

Recent Tweets

Note: For Customization and Configuration, CheckOut Recent Tweets Documentation

Calendar

<<  November 2019  >>
MoTuWeThFrSaSu
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

View posts in large calendar

Month List