How do I get environment variables from elastic beanstalk into an asp.net core mvc application? I have added a .ebextensions folder with app.config file in it with the follo
Instead of having to parse the containerconfiguration
you can leverage the ebextensions options to set the variable as part of your deploy process:
commands:
set_environment:
command: setx ASPNETCORE_ENVIRONMENT "Development" /M
This will set a global environment variable as part of your application deployment. This variable use-case is officially supported and documented by Microsoft.
After deploying your app you can verify the setting is set correctly in the EC2 instance: