I am in the process of deploying an ASP.NET WebAPI project to Elastic Beanstalk in AWS.
The WebAPI project relies on Entity Framework, and has a connection string property defined in the web.config under <connectionStrings>
as follows:
<connectionStrings>
<add name="myDBEntities" connectionString="metadata=res://*/myDBModel.csdl|res://*/myDBModel.ssdl|res://*/myDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=myServer\test;initial catalog=myDB;user id=myDBUser;password=PASS==;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
What I am aiming to do is have the entity framework "myDBEntities" connectionString name resolve via an entry under <appSettings>
section of the web.config instead, like so:
<appSettings>
<add key="myDBEntities" value="metadata=res://*/myDBModel.csdl|res://*/myDBModel.ssdl|res://*/myDBModel.msl;provider=System.Data.SqlClient;provider connection string="data source=myServer\test;initial catalog=myDB;user id=myDBUser;password=PASS==; multipleactiveresultsets=True;App=EntityFramework" providerName=System.Data.EntityClient;" />
</appSettings>
Note: I have dodgily added "providerName=System.Data.EntityClient;" to the end of the myDBEntities appSetting value in an attempt to get it to work / resolve. But no luck.
The removing of the connectionString setting and moving to under appSettings is so that it will configurable as an environment configuration setting in Elastic Beanstalk.
Any ideas / suggestions?