2
votes

I have the issue, that when I run my ASP.NET Project that it automatically creates a new Azure SQL Database (Gen 5 with 2 virtual cores for 340€/month). This is not specified anywhere I am nowhere in my code using anything like "context.Database.CreateIfNotExists" or "Migrate".

The connection string in the CloudConfiguration points to a Database Server that exists in Azure. Nevertheless, I don't want it to automatically create a new Azure SQL Database on that server.

Strange thing is, that it creates the new Azure SQL Database but it does not create any tables in it, so the Migrations from Entity Framework seem to not be applied.

1

1 Answers

1
votes

Run your app with a user who can't create databases, and see where it fails.

Only the administrators (Server admin login or Azure AD administrator) and the members of the dbmanager database role in the master database have permission to execute the CREATE DATABASE and DROP DATABASE statements.

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-manage-logins