Troubleshooting Connectivity Issues in Azure Synapse Analytics¶
Home > Troubleshooting > Connectivity Troubleshooting
This guide covers common connectivity and network-related issues in Azure Synapse Analytics, providing diagnostic approaches and solutions for establishing reliable connections to your Synapse workspace and its components.
Common Connectivity Issue Categories¶
Connectivity issues in Azure Synapse Analytics typically fall into these categories:
- Networking Configuration: Firewall rules, private endpoints, network security groups
- Authentication Problems: Token errors, identity issues, credential failures
- Service Availability: Regional outages, service health incidents
- Client Configuration: Driver issues, client tool misconfiguration
- Cross-Service Integration: Problems connecting Synapse to other Azure services
Networking Configuration Issues¶
Firewall Rules and IP Restrictions¶
Symptoms:
- Connection timeout errors
- "Cannot connect to server" messages
- Inconsistent connectivity (works from some locations but not others)
Solutions:
- Verify IP allowlisting:
- Check if client IP is allowed in Synapse firewall settings
- Ensure IP ranges cover all required client locations
# PowerShell: View firewall rules
Get-AzSynapseFirewallRule -WorkspaceName "synapseworkspace" -ResourceGroupName "resourcegroup"
# PowerShell: Add IP address to firewall
$ip = (Invoke-WebRequest -uri "https://api.ipify.org/").Content
New-AzSynapseFirewallRule -WorkspaceName "synapseworkspace" -ResourceGroupName "resourcegroup" -Name "AllowMyIP" -StartIpAddress $ip -EndIpAddress $ip
- Configure "Allow Azure services":
- Enable "Allow Azure services and resources to access this workspace" option
-
Useful for connections from other Azure resources
-
Check for dynamic IP issues:
- If using VPN or dynamic IP allocation, connections might fail after IP changes
- Consider using a gateway or fixed IP solution
Private Endpoint Configuration¶
Symptoms:
- Can't connect to Synapse when using private endpoints
- DNS resolution failures
- Connections working from VNet but not elsewhere
Solutions:
- Verify private endpoint provisioning:
- Check that private endpoints show "Succeeded" status
-
Validate connection group status
-
Check DNS configuration:
- Ensure private DNS zones are correctly linked to VNets
- Verify DNS records are properly created
# PowerShell: Check DNS records in private zone
Get-AzPrivateDnsRecordSet -ResourceGroupName "resourcegroup" -ZoneName "privatelink.sql.azuresynapse.net"
- Test DNS resolution:
- Use nslookup to verify DNS resolution from client machine
- Check if the workspace name resolves to private IP
- Review network security groups (NSGs):
- Verify NSGs allow required traffic
- Check for deny rules that might block connectivity
Network Security Groups (NSGs)¶
Symptoms:
- Intermittent connectivity issues
- Some services working while others fail
- Timeout errors rather than immediate rejections
Solutions:
- Review NSG rules:
- Check inbound and outbound security rules
- Ensure required ports are open
| Service | Protocol | Port |
|---|---|---|
| SQL | TCP | 1433 |
| Dev Endpoint | TCP | 443 |
| Spark | TCP | 443 |
- Configure service tags:
- Use Azure service tags like "Sql" in NSG rules
-
Implement least-privilege access model
-
Enable NSG flow logs:
- Set up NSG flow logs to diagnose blocked connections
- Review logs in Log Analytics or Traffic Analytics
# PowerShell: Enable NSG flow logs
$nsg = Get-AzNetworkSecurityGroup -Name "myNSG" -ResourceGroupName "resourcegroup"
$storageAccount = Get-AzStorageAccount -ResourceGroupName "resourcegroup" -Name "mystorageaccount"
Set-AzNetworkWatcherFlowLog -NetworkWatcherName "NetworkWatcher_region" -ResourceGroupName "NetworkWatcherRG" -TargetResourceId $nsg.Id -StorageAccountId $storageAccount.Id -EnableFlowLog $true -FormatType Json -FormatVersion 2
Authentication Problems¶
Token and Identity Issues¶
Symptoms:
- "Failed to authenticate" errors
- Token expiration messages
- Permission-related failures
- Single sign-on failures
Solutions:
- Check Azure AD configuration:
- Verify user exists in Azure AD tenant
- Check for conditional access policies
-
Validate multi-factor authentication settings
-
Inspect token validity and claims:
- Use jwt.ms to decode tokens
- Check expiration times and claims
-
Verify correct audience and issuer
-
Review Azure AD app registration:
- For application connections, check app registration settings
- Ensure redirect URIs are properly configured
-
Verify required API permissions
-
Test with alternative credentials:
- Try SQL authentication if available
- Test with a different user account
- Use admin account to isolate permission issues
Managed Identity Configuration¶
Symptoms:
- "Failed to obtain access token" errors
- Services unable to access each other
- Permission denied errors when using managed identities
Solutions:
- Verify managed identity is enabled:
- Check that managed identity is enabled for services
-
Validate system-assigned vs. user-assigned configuration
-
Check RBAC assignments:
- Ensure managed identity has appropriate RBAC roles
- Common roles include "Storage Blob Data Contributor" for ADLS access
# PowerShell: View role assignments for managed identity
$id = (Get-AzSynapseWorkspace -Name "synapseworkspace" -ResourceGroupName "resourcegroup").Identity.PrincipalId
Get-AzRoleAssignment -ObjectId $id
# PowerShell: Assign Storage Blob Data Contributor role
$storage = Get-AzStorageAccount -ResourceGroupName "resourcegroup" -Name "storage"
New-AzRoleAssignment -ObjectId $id -RoleDefinitionName "Storage Blob Data Contributor" -Scope $storage.Id
- Refresh tokens:
- Use PowerShell or Azure Cloud Shell to test token acquisition
- Validate that identity can access required resources
Service Availability¶
Regional Outages and Service Health¶
Symptoms:
- Widespread connectivity issues
- All components of Synapse affected
- Similar issues reported by others
Solutions:
- Check Azure Service Health:
- Review Azure Status
- Check for active advisories or incidents
-
Look for Synapse-specific or regional issues
-
Review service health in Azure portal:
- Go to Azure portal > Service Health
- Filter for Synapse Analytics service
-
Check for current or planned maintenance
-
Configure service health alerts:
- Set up alerts for service issues
- Receive notifications for planned maintenance
# PowerShell: Create service health alert
$condition = New-AzActivityLogAlertCondition -Field "category" -Equal "ServiceHealth" `
-AndCondition (New-AzActivityLogAlertCondition -Field "properties.serviceHealthData.service" -Equal "Synapse Analytics")
New-AzActivityLogAlert -Location "Global" -Name "SynapseHealthAlert" `
-ResourceGroupName "resourcegroup" `
-Condition $condition `
-ActionGroupId "/subscriptions/subid/resourceGroups/resourcegroup/providers/microsoft.insights/actionGroups/actiongroup"
Client Configuration¶
Driver and Client Tool Issues¶
Symptoms:
- Connection errors from specific tools or applications
- Authentication works in some tools but not others
- "Driver not found" or version incompatibility errors
Solutions:
- Update ODBC/JDBC drivers:
- Use the latest SQL Server drivers
- Check for compatibility with Azure Synapse
# Example connection string for JDBC
jdbc:sqlserver://<workspace-name>.sql.azuresynapse.net:1433;database=<database>;user=<user>@<workspace-name>;password=<password>;encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.sql.azuresynapse.net;loginTimeout=30;
- Check TLS/encryption settings:
- Ensure TLS 1.2+ is enabled
- Verify encryption is enabled in connection strings
-
Check for certificate validation issues
-
Validate connection strings:
- Use correct server naming format:
<workspace-name>.sql.azuresynapse.net - Include all required parameters
-
Test connection string with a simple tool like SSMS
-
Test with different tools:
- Try SQL Server Management Studio
- Test with Azure Data Studio
- Use sqlcmd command-line utility
# Using sqlcmd
sqlcmd -S <workspace-name>.sql.azuresynapse.net -d master -U <username> -P <password> -I -Q "SELECT @@VERSION"
Cross-Service Integration¶
Storage Connectivity Issues¶
Symptoms:
- Synapse can't access storage accounts
- "Access denied" when reading/writing data
- Permission errors during query execution
Solutions:
- Check storage account network settings:
- Verify firewall rules allow Synapse access
- Check if "Allow trusted Microsoft services" is enabled
-
Ensure private endpoint configuration if used
-
Verify user permissions:
- Verify Synapse managed identity has proper RBAC roles
- Check for Storage Blob Data Reader/Contributor roles
-
Verify ACLs if using hierarchical namespace
-
Test storage connectivity:
-- SQL Serverless Pool test
SELECT TOP 10 *
FROM OPENROWSET(
BULK 'https://storageaccount.dfs.core.windows.net/container/folder/*',
FORMAT = 'CSV',
PARSER_VERSION = '2.0',
HEADER_ROW = TRUE
) AS [result]
# PySpark test
df = spark.read.csv("abfss://container@storageaccount.dfs.core.windows.net/folder/")
df.show(5)
Key Vault Integration Issues¶
Symptoms:
- Can't retrieve secrets from Key Vault
- "Access denied" errors when using linked services
- Authentication failures for services using Key Vault credentials
Solutions:
- Check Key Vault access policies:
- Ensure Synapse managed identity has "Get" and "List" permissions
- Verify no deny assignments blocking access
# PowerShell: Grant Key Vault permissions
$id = (Get-AzSynapseWorkspace -Name "synapseworkspace" -ResourceGroupName "resourcegroup").Identity.PrincipalId
Set-AzKeyVaultAccessPolicy -VaultName "keyvault" -ObjectId $id -PermissionsToSecrets Get,List
- Verify network access:
- Check Key Vault firewall settings
-
Ensure Synapse can reach Key Vault (public or private endpoint)
-
Test Key Vault linked service:
- Create a simple linked service to Key Vault
- Test connection from Synapse UI
- Check for specific error messages
Diagnosing Connection Issues¶
Diagnostic Tools¶
- Network Packet Capture:
- Use tools like Wireshark or Network Watcher Packet Capture
-
Look for connection attempts, failures, or timeouts
-
Connection Test Tools:
- Use Test-NetConnection (PowerShell) to check port connectivity
- Run network trace to identify connectivity problems
# PowerShell: Test SQL connectivity
Test-NetConnection -ComputerName "<workspace-name>.sql.azuresynapse.net" -Port 1433
- Azure Network Watcher:
- Use Connection Troubleshoot feature
- Check for network topology issues
- Validate NSG and routing configuration
# PowerShell: Test connection with Network Watcher
$source = Get-AzNetworkInterface -Name "sourceNIC" -ResourceGroupName "sourceRG"
$dest = Get-AzNetworkInterface -Name "destNIC" -ResourceGroupName "destRG"
Test-AzNetworkWatcherConnectivity -NetworkWatcherName "NetworkWatcher_region" `
-ResourceGroupName "NetworkWatcherRG" `
-SourceId $source.Id `
-DestinationId $dest.Id `
-DestinationPort 1433
Logging and Monitoring¶
- Enable diagnostic logging:
- Configure Azure Monitor for Synapse
- Send logs to Log Analytics workspace
- Set up alerting for connection failures
# PowerShell: Enable diagnostic settings
$workspace = Get-AzOperationalInsightsWorkspace -ResourceGroupName "resourcegroup" -Name "logworkspace"
$synapse = Get-AzSynapseWorkspace -Name "synapseworkspace" -ResourceGroupName "resourcegroup"
Set-AzDiagnosticSetting -Name "SynapseDiagnostics" -ResourceId $synapse.Id `
-WorkspaceId $workspace.ResourceId -Enabled $true `
-Category "SynapseRbacOperations", "GatewayApiRequests", "BuiltinSqlReqsEnded", "IntegrationPipelineRuns"
- Query logs for connection failures:
- Use KQL queries to search for error patterns
-- Log Analytics query for SQL connection failures
SynapseBuiltinSqlPoolRequestsEnded
| where StatusCode != 0
| where TimeGenerated > ago(24h)
| order by TimeGenerated desc
- Monitor network health:
- Set up connection monitors in Network Watcher
- Create dashboards for network performance metrics
Best Practices for Reliable Connectivity¶
- Implement proper network design:
- Use private endpoints for enhanced security
- Design appropriate network segmentation
-
Implement hybrid connectivity patterns correctly
-
Create comprehensive firewall rules:
- Document all required IP ranges
- Review and audit firewall rules regularly
-
Consider using service endpoints where appropriate
-
Plan for disaster recovery:
- Document connection procedures
- Create connectivity testing runbooks
-
Prepare for regional outages or service disruptions
-
Use managed identities:
- Leverage managed identities for service-to-service authentication
- Reduce reliance on connection strings with secrets
- Implement least-privilege access model
Related Topics¶
- Network Security Configuration for Synapse
- Private Link Configuration Guide
- Authentication Best Practices
- Monitoring and Logging Setup