I am using the following connection string (from the "Show database connection strings" option in the Azure portal") to connect to an Azure SQL database;
services.AddDbContext<PwttContext>(options => options.UseSqlServer("Server=tcp:<serverName>.database.windows.net,1433;Initial Catalog=<databaseName>;Persist Security Info=False;User ID=<userId@organisation.com>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication='Active Directory Password';"));
However when I run a Update-Database
in the Package Manager console I get the following error;
System.ArgumentException: Keyword not supported: 'authentication'
I have tried Authentication=""Active Directory Password""
and Authentication="\Active Directory Password\"
to escape the quote characters with no success.
If I remove the Authentication
key word and value and use;
services.AddDbContext<PwttContext>(options => options.UseSqlServer("Server=tcp:<serverName>.database.windows.net,1433;Initial Catalog=<databaseName>;Persist Security Info=False;User ID=<userId@organisation.com>;Password=<password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;"));
I then get the error System.Data.SqlClient.SqlException (0x80131904): Cannot open server "organisation.com" requested by the login. The login failed