Windows Integrated Security Credentials with Azure SQL Server causing ERROR CODE: SEC_ERROR_INADEQUATE_KEY_USAGE

How do I fix "An error has occurred during connection to . Certificate key usage inadequate for attempted operation ERROR CODE: SEC_ERROR_INADEQUATE_KEY_USAGE" with an Azure SQL Databse?

Resolution:
If SQL Server Authentication is not used, to maintain Active Directory login, Active Directory Integrated authentication on SQL should be used.

  • It can be verified by taking a look at the authentication methods allowed on SQL Server:
  • On IIS, click on Connection String:
  • Change the connection string to "Custom" and paste and edit the following connection string to connect to the desired Azure SQL server:
Server=tcp:.database.windows.net,1433;Initial Catalog=;Persist Security Info=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication="Active Directory Integrated";