Azure SQL Server Connection Error Despite Correct Credentials - Error Number:18456,State:1,Class:14

asked 2020-02-27T20:17:26.997+00:00
Ben Hayward 1 Reputation point

I have created a new SQL Database on Azure, and have copied the connection string directly from the Azure Portal.

On my .NET application, when I am trying to run 'Update-Database' command in Package Manager Console to commit the migration, I receive the following error:

Error Number:18456,State:1,Class:14
Login failed for user 'benhayward'.

I can confirm that the log-in credentials are correct as I can log into the server explorer on Visual Studio using the same credentials.

My connection string:

"ApplicationDbContextConnection": "Server=tcp:sepmdatabase.database.windows.net,1433;Initial Catalog=SEPMDatabase;Persist Security Info=False;TRUSTED_CONNECTION = TRUE;User ID=benhayward;Password={XXXXXXX};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"

Extra Information:

  • I have changed my database admin password.
  • I have confirmed that the log-in credentials are correct.
  • I am on the Azure free trial.

Any advice or assistance on this would be greatly appreciated.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
4,561 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2020-03-02T00:11:03.547+00:00
    Jonel M Rienton 1 Reputation point

    Hi,

    Trusted_Connection and the user id/password are mutually exclusive. When you set the Trusted_Connection=True, the application is sending the security principal your .Net application is running on.

    When you set Trusted_Connection=True, you do not need to provide the User Id and Password parameter/values.

    No comments