Azure SQL Database - randomly error: Login failed for user '***' - azure

I get randomly from time to time error Login failed for user '***' when the application tries to connect with Azure SQL Database.
In most cases application has no problem with logging in to that user, unfortunately from time to time I get such an error. DB hasn't problems (at least I don't see any of them) isn't overloaded no alerts, only that problem that happens from time to time

Login failed for user ‘***’
The error occurs when the username or password or there’s something missing in the connection string. You can check the Azure SQL log-in logs in the Audit Logs section of your Azure SQL server and you can explicitly view #sys.event_log logs table to check the connectivity failures of your Azure SQL.
I created one console app and reproduced the same Login failed for user error where my db name in the connection string is wrong, Similar error might occur if you add an incorrect password or if a password change is not updated in your connection string Refer to below:-
You can enable Audit Logs for your Azure SQL DB like below to get more insights on the connection failure:-
Audit Logs are sent to Log analytics like below:-
Database Authentication logs :-
You can also auto-resolve the connection issue by visiting Diagnose and solve problems section of your Azure SQL DB where you can select your issue and Azure will run diagnostics queries/recommendation on your Azure SQL DB like below:-
For Connectivity -Connection Timeouts issues, Query is recommended like below:-
You can also query the connection failed logs directly in the SSMS like below:-
Select * From sys.event_log
Reference:-
sys.event_log (Azure SQL Database) - SQL Server | Microsoft Learn
Azure SQL Auditing for Azure SQL Database and Azure Synapse Analytics - Azure SQL Database | Microsoft Learn

Related

Can Azure Monitor be used to track changes to database entities?

I created Audit Trail in my database by overriding EF Core SaveChanges and SaveChangesAsync methods and storing if entity was Added, Removed, Edited, what columns where edited and what user did it.
However, I became aware of Azure Monitor, but I cannot find information is it possible to track changes made to records stored in selected errors using Azure Monitor instead of what I've done?
if entity was Added, Removed, Edited,what columns where edited and what user did it. is it possible to
track changes made to records stored in selected errors using Azure
Monitor instead of what I’ve done?
Yes, You can make use of audit logs to get the logs of commands executed in your Azure SQL on Inserting, Selecting, and Creating the data. You can make use of Azure Monitor Performance management and SQL Insights to get information and logs on the Top queries and errors on the query execution by the user. You can send your Azure SQL Logs to the Log Analytics workspace and query the details.
Audit Logs:-
Enable Audit Logs for your Azure SQL server like below and send the data to Log Analytics, You can also store the data in your Storage account. :-
Enable Azure SQL Server level logging:-
Enable Azure SQL DB level logging for Database events:-
This will create one Log analytics solution for the SQL audit logs in the selected LA workspace and you can find your Azure SQL DB records and logs below :-
Solution :-
You can also find the Top executed queries and error codes if the queries failed here in the Performance overview:-
Click on the Top executed query details row and you will find additional details on the query like below :-
You can send Azure SQL Logs via diagnostics settings too and send it to Log Analytics Workspace:-
If you’re connected to SSMS, you can import your audit logs to SSMS by storing the audit logs in your storage account first and then importing it like below :-

Azure App Service ( Sonarqube ) tables is not create in Azure SQL Database

1.I'm unable to connect AzureSQL DB from Azure APP Services.
2.In Azure App Services Sonarqube is running with 8.9.7 version i created some of the projects and i passed the connection string on with JDBC URL , User Name , Password and default tables is not creating.
3.Both db and password are correct manul i treid to login into db as well showing zero tables.
4.I'm getting one more exception with "*****Embedded database should be used for evaluation purposes only
The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.****"
Below are the screen shot for reference.

ADF Unable to connect to Synapse Link SQL Pool External Tables

I am trying to create an ADF Linked Service connection to a Synapse Link Serverless SQL Pool connected to ADSL Storage. I can successfully get a connection but when I try and use a dataset to access the data I get a permission issue.
I can successfully access the data via Synapse studio :
This is the error I get when I use the data set in ADF.
I can also look at the schemas in SSMS , where they appear as External tables. But get a similar credential error at the same point.
Has anyone come across this issue please ?
There are a few pieces of information you haven’t supplied in your question but I believe I know what happened. The external table worked in Synapse Studio because you were connected to the Serverless SQL pool with your AAD account and it passed through your AAD credentials to the data lake and succeeded.
However when you setup the linked service to the Serverless SQL Pool Im guessing you used a SQL auth account for the credentials. With SQL auth it doesn’t know how to authenticate with the data lake so looked for a server scoped credential but couldn’t find one.
The same happened when you connected from SSMS with a SQL auth account I’m guessing.
You have several options. If it’s important to be able to access the external table with SQL auth you can execute the following to tell it how to access the data lake. This assumes the Synapse Workspace Managed Service Identity has Storage Blob Data Reader or Storage Blob Data Contributor role on the data lake.
CREATE CREDENTIAL [https://<YourDataLakeName>.dfs.core.windows.net]
WITH IDENTITY = 'Managed Identity';
Or you could change the authentication on the linked service to use the Managed Service Identity.

Azure Stream Analytics - User Verification

I have data in an Event Hub which i'm passing to an Azure SQL Server database via a Stream Analytics job. I've had it working, but now when i start the job i get a 'Login failed for user xxx'.
I can log into the database and make changes etc using Azure Data Studio or via the Azure portal, but when i try to test the Output connection or run the job, it fails with the above error. The user exists and has admin access etc. Anyone seen this before ?
Thanks in advance
JC
This problem is generally caused by the firewall, so first check the firewall of your sql server.
enter image description here

not able to find master database under azure SQL server (dw)

I am trying to scale Azure SQLDW by following this document => azure link but help guide says, to run query under master DB.
I am logging in using system admin credential,
what am i missing.
Azure SQL DW master DB is the same with Azure SQL Server.
Please run the query in Database--System Database--master.
Login your Azure SQL DW with admin account, set the connect to database.
Step 1
Step 2
Step3
Hope this helps.
Given the first screen shot, it appears that you've connected to the user database and not the server with the default database. When connecting to your server in SSMS, click on the Connection Properties tab and make sure the Connect to database: value is set to <default>.
Connection Properties

Resources