GithubHelp home page GithubHelp logo

Comments (4)

costa100 avatar costa100 commented on June 20, 2024

I ended up placing the connection strings in the appsettings.development.json file. This file is not committed in git. One of the other things we need to do when we get a new version updated by another developer, is to apply his database updates.

Any other thoughts or advice, perhaps there is a better way?

Also, please improve this paragraph:

# 'envVars' allow you to use configuration values from environment varibles. Supply the

I do not understand the behaviour, what it means exactly that the prefix will be removed from the environment variable. Why does it need to be removed? An example would help a lot.

Thanks!

from facil.

cmeeren avatar cmeeren commented on June 20, 2024

I believe user secrets are the standard way to solve this.

appsettings.development.json should, as I understand it, be committed and thus not contain developer-specific stuff.

You can read more about configuration here. This includes prefixed environment variables. Note that the prefix can be empty.

from facil.

cmeeren avatar cmeeren commented on June 20, 2024

In the reference YAML file, in the description for the configs property, I link to two official articles that explain all the configuration sources. So I believe this is explained well enough. Let me know if you still disagree.

# The optional 'configs' section allows you to specify where variables are resolved from.
# Each array item translates more or less exactly into a call to the corresponding
# Microsoft.Extensions.Configuration.ConfigurationBuilder.Add* method, in the order you
# specify here (i.e., later config sources will override already added config sources if
# there are collisions). Any config type may be added multiple times. This section is only
# required if you are using variables (e.g. for the connection string). For more
# information, see:
# - https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration
# - https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.configurationbuilder
configs:
# 'appSettings' allow you to use configuration values from appsettings.json.
- appSettings: path/from/project/to/appsettings.json
# 'userSecrets' allow you to use configuration values from user secrets.
- userSecrets: 80d5e7ec-f577-4360-b60a-f10ea004da1d
# 'envVars' allow you to use configuration values from environment varibles. Supply the
# prefix that environment variable names must start with. The prefix will be removed
# from the environment variable names.
- envVars: ""

from facil.

costa100 avatar costa100 commented on June 20, 2024

It's all good - like you said, it's in the MS documentation. Thank you!

from facil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.