Azure EF SQL Database The first connection string in the Azure Management Portal

I have an n Azure site that uses the first EF Database model.

If I insert the connection string in web.config and deploy everything, it is rosy.

<add name="MyEntities" connectionString="metadata=res://*/App_Code.Model.csdl|res://*/App_Code.Model.ssdl|res://*/App_Code.Model.msl;provider=System.Data.SqlClient;provider connection string='Data Source=my.database.windows.net;Initial Catalog=myTest_DB;User ID=***;Password=***; MultipleActiveResultSets=False'" providerName="System.Data.EntityClient"/> 

But I do not need the connection string in the web.config file, since it contains the credentials.

So, I moved it to the connection string area in the Azure properties.

The first issue I got into was getting an invalid metadata error.

I decided that changing the type from the SQL database to a custom one.

enter image description here

However, now I get this error:

The connection string 'MyEntities' in the application configuration file does not contain the required providerName attribute. "

I trawled the web and tried many connection string options but haven't found the right one yet.

Note. I suppose I can do this by tweaking the application and moving the line initialization to code, but even if for the sake of curiosity I would like to know how to do this through the portal.

+6
source share
1 answer

The problem is not the connection string, but the inability to specify providerName from the portal.

Try publishing a local or dummy connection string and overwrite it the same way you did in the Azure Application settings. See This Answer: fooobar.com/questions/954365 / ...

+2
source

All Articles