How to read Elastic Beanstalk Environment Properties in .net?

后端 未结 3 928
日久生厌
日久生厌 2020-12-15 07:59

How can I read the Environment Properties from my AWS Elastic Beanstalk Application found here:

Configuration > Software Configuration > Environment Pr         


        
3条回答
  •  半阙折子戏
    2020-12-15 08:46

    It is true that on AWS Doc (Using the AWS Elastic Beanstalk .NET Platform) it is indicated :

    Settings applied in the AWS Management Console override the same settings in configuration files, if they exist. This lets you have default settings in configuration files, and override them with environment-specific settings in the console. For more information about precedence, and other methods of changing settings, see Configuration Options.

    ... I think it refers to the .ebextensions configuration files, and not the app.config or web.config files. See in link indicated above, there is reference to the 'precedence' rules that apply ; it is indicated that what takes precendence are 'Settings specified during a create environment or update environment', so what I understand is settings values set during the deployement take precedence (and these settings are in the app.config/web.config).

    I have just tested this, and Matt Houser answer above is correct and still stands. You have to remove app.config/web.config keys on in the deployed version to see the 'Environment properties' be taken into consideration.

提交回复
热议问题