question

BenHayward-7503 avatar image
BenHayward-7503 asked ·

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

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
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JonelMRienton-3402 avatar image
JonelMRienton-3402 answered ·

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.

Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.