Forum Discussion
connectivity issues with Azure SQL Database
error messages when the connection to Azure SQL Database or Azure SQL Managed Instance fails. These connection problems can be caused by reconfiguration, firewall settings, a connection timeout, incorrect login information'
Use Below Power Shell Code to detect connection issue.
$parameters = @{
# Supports Single, Elastic Pools and Managed Instance (please provide FQDN, MI public endpoint is supported)
# Supports Azure Synapse / Azure SQL Data Warehouse (*.sql.azuresynapse.net / *.database.windows.net)
# Supports Public Cloud (*.database.windows.net), Azure China (*.database.chinacloudapi.cn), Azure Germany (*.database.cloudapi.de) and Azure Government (*.database.usgovcloudapi.net)
Server = '.database.windows.net' # or any other supported FQDN
Database = '' # Set the name of the database you wish to test, 'master' will be used by default if nothing is set
User = '' # Set the login username you wish to use, 'AzSQLConnCheckerUser' will be used by default if nothing is set
Password = '' # Set the login password you wish to use, 'AzSQLConnCheckerPassword' will be used by default if nothing is set
## Optional parameters (default values will be used if omitted)
SendAnonymousUsageData = $true # Set as $true (default) or $false
RunAdvancedConnectivityPolicyTests = $true # Set as $true (default) or $false, this will load the library from Microsoft's GitHub repository needed for running advanced connectivity tests
CollectNetworkTrace = $true # Set as $true (default) or $false
#EncryptionProtocol = '' # Supported values: 'Tls 1.0', 'Tls 1.1', 'Tls 1.2'; Without this parameter operating system will choose the best protocol to use
}
$ProgressPreference = "SilentlyContinue";
if ([string]::IsNullOrEmpty($parameters.RepositoryBranch)) {
$branch = 'master'
} else {
$branch = $parameters.RepositoryBranch
}
if ("AzureKudu" -eq $env:DOTNET_CLI_TELEMETRY_PROFILE) {
$scriptFile = '/ReducedSQLConnectivityChecker.ps1'
} else {
$scriptFile = '/AzureSQLConnectivityChecker.ps1'
}
$scriptUrlBase = 'raw.githubusercontent.com/Azure/SQL-Connectivity-Checker/' + $branch
Invoke-Command -ScriptBlock ([Scriptblock]::Create((Invoke-WebRequest ($scriptUrlBase + $scriptFile) -UseBasicParsing).Content)) -ArgumentList $parameters
#end
1 Reply
May try this before contacting Microsoft support 1. Run the Connectivity Checker with RunAdvancedConnectivityPolicyTests = $true and CollectNetworkTrace = $true for compliance-ready logs. 2. Check firewall rules: Ensure your client IP is allowed in the Azure SQL Server firewall. 3. Verify login credentials: Incorrect usernames or passwords are a common cause. 4. TLS settings: If your environment enforces TLS 1.2, specify it explicitly in the script.