We have an ASP .NET (MVC) app and are using Entity Framework 6 to connect to our databases. The DbContext is constructed in a standard way and it loads the connection string
Just recording my own experiences in addition to answers already recorded here
This was my final connection string (on mutliple lines for clarity)
metadata=res://*/Models.mBT.csdl|res://*/Models.mBT.ssdl|res://*/Models.mBT.msl;
provider=System.Data.SqlClient;
provider connection string="
Data Source=tcp:myazureserver.database.windows.net,1433;
Initial Catalog=databasename;
User ID=z@myazureserver;
Password=xyz"
To convert from a "normal" connection string to one that is accepted by EF:
Models.mBT.csdl (and the other two) comes from this:Firstly, mBT is the name of my .edmx file
With regards to the Model. bit, see the answer from @leqid here: MetadataException: Unable to load the specified metadata resource
You can inspect your obj directory and see these three metadata files are in a subfolder called Models, so you need to prepend with Models.