Home

sql_request in Log Analytics always failed to connect to azure sql database.

%3CLINGO-SUB%20id%3D%22lingo-sub-743619%22%20slang%3D%22en-US%22%3Esql_request%20in%20Log%20Analytics%20always%20failed%20to%20connect%20to%20azure%20sql%20database.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-743619%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20query%20using%20in%20azure%20log%20analytics%20using%20Azure%20Directory%20Integrated%20authentication.%3C%2FP%3E%0A%3CPRE%3Eevaluate%20sql_request(%0A%20%20'Server%3Dtcp%3Asomedb.database.windows.net%2C1433%3B'%0A%20%20'Authentication%3D%22Active%20Directory%20Integrated%22%3B'%0A%20%20'Initial%20Catalog%3Dsometable%3B'%2C%0A%20%20'SELECT%20*%20from%20%5Bdbo%5D.%5Bsometable%5D'%0A)%3C%2FPRE%3E%0A%3CP%3EIt%20kept%20failing%20with%20this%20error%20and%20network%20traces%20shows%20a%20502%20error.%3C%2FP%3E%0A%3CPRE%3EWe%20have%20experienced%20a%20connection%20issue%20while%20retrieving%20data.%3CBR%20%2F%3EThis%20is%20usually%20an%20indication%20that%20the%20network%20is%20down%20or%20a%20firewall%20or%20browser%20extension%20(such%20as%20an%20ad%20blocker)%20is%20mistakenly%20preventing%20access.%3C%2FPRE%3E%0A%3CP%3EI've%20already%20added%20all%20Application%20Insights%20IPs%20to%20database's%20firewall.%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fapp%2Fip-addresses%23application-insights-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fapp%2Fip-addresses%23application-insights-api%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-743619%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EApplication%20Insights%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
daweil
Microsoft

I have a query using in azure log analytics using Azure Directory Integrated authentication.

evaluate sql_request(
  'Server=tcp:somedb.database.windows.net,1433;'
  'Authentication="Active Directory Integrated";'
  'Initial Catalog=sometable;',
  'SELECT * from [dbo].[sometable]'
)

It kept failing with this error and network traces shows a 502 error.

We have experienced a connection issue while retrieving data.
This is usually an indication that the network is down or a firewall or browser extension (such as an ad blocker) is mistakenly preventing access.

I've already added all Application Insights IPs to database's firewall.

https://docs.microsoft.com/en-us/azure/azure-monitor/app/ip-addresses#application-insights-api

 

 

Related Conversations
Add Import/Export Flags option
HotCakeX in Discussions on
7 Replies
Powershell Script for Vault details.
Prashant Sharma in Azure on
2 Replies
updating my OMS queries
vicky2019 in Azure on
3 Replies
Duplicate Extensions and Abusing Extension report
HotCakeX in Discussions on
6 Replies