Complete the first steps of migrating to remote Azure

I am publishing an Azure Web application, and I ran into a weird problem performing the first code migrations.

The remote connection string for this database is working fine if I do not check "Perform the first code migrations."

Publish Web

However, if I check the box, a strange connection string is entered into the remote web.config with the curious spelling "ConnetionString":

<add name="DbContext_DatabasePublish" connectionString="DbContext_DatabasePublish.ConnetionString" providerName="System.Data.SqlClient" /> 

This, of course, is not a valid connection string, and the EF initializer throws this exception

The format of the initialization string does not match the specification starting at index 0

The publishing behavior is the same regardless of whether the local connection string refers to localdb, or whether the connection string is not defined in the local web.config at all.

Am I missing something obvious?

+1
source share
2 answers

In Azure, I ended up having to define connection strings for DbContext and DbContext_DatabasePublish in order to migrate. This MSDN message and this answer will ultimately lead me to this conclusion.

I am not sure why I do not see any more references to this problem. It seems like this would be a common problem.

+1
source

So glad I found this - I struggled with exactly the same problem! I added myDB_DatabasePublish to the Azure connection strings for my application (not sure where Lauren added it). Migration occurs automatically at startup, and the password never belongs to the developer (there is no chance that it will penetrate the version control system).

0
source

All Articles