Credentials are missing or not valid.\r\n inner exception: The credentials provided for the SQL source are invalid. (Source at tcp:peoplecounterserver.database.windows.net;lotDB.
The error message you're encountering suggests that Azure is unable to authenticate your credentials when trying to connect to the SQL Server. Even if you've verified the username and password, there are several other factors that might cause this.
Ensure your connection string is correct. For Azure SQL, the format is typically:
Server=tcp:peoplecounterserver.database.windows.net,1433;Initial Catalog=lotDB;Persist Security Info=False;User ID=<your_username>;Password=<your_password>;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
- Server ends in
.database.windows.net
- Try
User ID
is in the formatusername@servername
- You do not have a semicolon
;
or whitespace in the password.
If you are using SQL Authentication it requires a SQL login explicitly defined on the server. For Azure Active Directory (AAD) authentication requires AAD users to be granted roles on the database (e.g., db_datareader
, db_owner
) and configured appropriately in the connection client.
When accessing the SQL Database from Azure-hosted services (e.g., Logic Apps, App Services), ensure that Managed Identity is configured and granted access on the SQL Database. Required role-based access control (RBAC) and database-level permissions to authenticate.
As we can see you are connecting azure SQL from web app for that you can refer below documentations:
Please review the scenarios mentioned above. If the issue still persists, feel free to reach out with the requested details so we can assist you further.