I’m trying to deploy a MVC4 EF5 code-first application on Azure. After publishing I get this error on the site:
Error. An error occurred while processing your request.
I guess thats because the tables aren’t being created in the database?
My connectionstring:
Data Source=tcp:6666666.database.windows.net,1433;Initial Catalog=eatart_db;User Id=kasperskov@6666666;Password=yourmother
I have automatic migrations enabled in the config and I am executing it on deployment:
internal sealed class Configuration : DbMigrationsConfiguration<EatArt.Models.EatArtDb>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
}
In my Application_Start (global.asax):
Database.SetInitializer(new DropCreateDatabaseIfModelChanges<EatArtDb>());
ALSO. This notification pops op on my azure portal:
The server encountered an error while retrieving metrics. Retry the
operation.
What am I missing here? Am I doing anything wrong?
As Ben Tidman suggested, I ran the Update-Database command in the package manager console onto the Azure database. That triggered the creation of the tables and I was able to deploy a view the page right away.
Ps. Had to add
Trusted_Connection=falseandencrypt=trueto the connection string of course..