AWS Elastic Beanstalk environment variables in Asp.Net Core 1.0- already worked with. I added a .ebextensions folder with [login to view URL] file:
option_settings:
option_name: HelloWorld
value: placeholder
option_name: ASPNETCORE_ENVIRONMENT
value: placeholder
The .ebextensions folder is included in the publish package. On deployment, both the variables are visible in the aws elasticbeanstalk console at Configuration > Software Configuration > Environment Variables
However, when I tried to read the variables in the application, none of the below options are working:
[login to view URL]("HelloWorld") // In controller
Configuration["HelloWorld"] // In [login to view URL]
Later, I have added the file:
var builder = new ConfigurationBuilder()
.SetBasePath("C:\Program Files\Amazon\ElasticBeanstalk\config")
.AddJsonFile("containerconfiguration", optional: true, reloadOnChange: true);
And then access the values and it works fine. So not a newbie with AWS Elastic Beanstalk.
To Publish Asp.Net API to AWS Elastic Beanstalk, Create New Application wizard in the Elastic Beanstalk console to create the application environment; Add database instance to the environment; Net with the AWS Toolkit for Visual Studio, will publish the API to Elastic Beanstalk.
Next need to configure the Client Application to connect API.
Now, I need to discuss with you few things before I make any commitment or start working with. Please ping me on your convenience.