1

I just deployed my website to azure and i got this error instantly. I tried reading some other posts about the same problem, but i couldn't find a fix. Here is the process i went through to deploy:

  1. Clicked publish in visual studio
  2. Under "select publish target" i chose microsoft azure websites
  3. Created the web app and sql database
  4. Under settings -> databases, it said AppIdentityDbContext(IdentityDb) and showed me this string:

Data Source=tcp:eaduy2evm7.database.windows.net,1433;Initial Catalog=TandForumTestVersion_db;User Id=tandforum_test@eaduy2evm7;Password=********

  1. I checked "use this connection string at runetime" and "execute code first migrations" options
  2. Clicked publish

This exception thrown:

[InvalidOperationException: The ConnectionString property has not been initialized.]

Here is my connection string in the Webconfig file:

<add name="IdentityDb" providerName="System.Data.SqlClient" connectionString="Data Source=(localdb)\v11.0;Initial Catalog=IdentityDb;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False; MultipleActiveResultSets=True" />

Context class:

public class AppIdentityDbContext : IdentityDbContext<AppUser>
{
    public AppIdentityDbContext() : base("IdentityDb")
    {
    }
}

Configuration class in Migrations folder:

internal sealed class Configuration : DbMigrationsConfiguration<TandForum.dk.Data_Acces_Layer.AppIdentityDbContext>
{
    public Configuration()
    {
        AutomaticMigrationsEnabled = true;
        ContextKey = "TandForum.dk.Data_Acces_Layer.AppIdentityDbContext";
    }
}

I would really appreciate any help

Aeterna
  • 347
  • 6
  • 11
  • have you checked https://stackoverflow.com/questions/22865584/the-connectionstring-property-has-not-been-initialized-on-update-database – mcy Aug 31 '15 at 10:48

0 Answers0