<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Databricks cluster cannot reach SQL Server over VPC peering despite EC2 connectivity - AWS in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/150095#M53239</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/218789"&gt;@learti&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is a very common scenario -- EC2 instances in the Databricks subnets can reach your SQL Server, but the Databricks cluster itself cannot. The good news is that VPC peering is fully supported with Databricks-managed VPCs, so this is NOT a fundamental limitation. The issue is almost certainly a configuration detail in one of the areas below.&lt;/P&gt;
&lt;P&gt;Here are the most likely causes, in order of probability:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #1: SECURITY GROUP MISCONFIGURATION (MOST LIKELY)&lt;/P&gt;
&lt;P&gt;When Databricks creates a managed VPC, it provisions two security groups:&lt;/P&gt;
&lt;P&gt;- A "Managed" security group (used internally by Databricks -- do NOT modify this)&lt;BR /&gt;- An "Unmanaged" security group (this is the one your cluster nodes actually use for outbound traffic)&lt;/P&gt;
&lt;P&gt;The key issue: Your SQL Server's security group needs an inbound rule that allows traffic from the Databricks "Unmanaged" security group -- not the Managed one, and not the subnet CIDR.&lt;/P&gt;
&lt;P&gt;How to fix:&lt;BR /&gt;1. In the AWS VPC Dashboard, find the security groups associated with your Databricks VPC&lt;BR /&gt;2. Identify the security group with "Unmanaged" in the name and copy its ID&lt;BR /&gt;3. Go to the security group attached to your SQL Server instance&lt;BR /&gt;4. Add an inbound rule: Custom TCP / Port 1433 / Source = the Unmanaged security group ID&lt;/P&gt;
&lt;P&gt;This is different from what you tested with EC2 instances. Your EC2 instances may have been using a different security group, or the SQL Server security group may allow traffic from the subnet CIDR but not from the Databricks Unmanaged security group specifically.&lt;/P&gt;
&lt;P&gt;Docs (Steps 7-8): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #2: ROUTE TABLE ASSOCIATION MISMATCH&lt;/P&gt;
&lt;P&gt;This is the second most common cause. The VPC peering documentation instructs you to add the peering route to the Databricks VPC's main route table. However, the subnets where Databricks cluster nodes actually run may be using custom (non-main) route tables instead of the main route table.&lt;/P&gt;
&lt;P&gt;How to verify:&lt;BR /&gt;1. Go to VPC Dashboard &amp;gt; Subnets and find the subnets in your Databricks VPC&lt;BR /&gt;2. For each subnet, check the Route Table tab -- note which route table is associated&lt;BR /&gt;3. If any subnet uses a route table other than the main route table, you need to add the peering route to THAT route table as well&lt;BR /&gt;4. The route should be: Destination = SQL Server VPC CIDR / Target = peering connection ID&lt;/P&gt;
&lt;P&gt;Your EC2 test instances may have been in a subnet that uses the main route table (where the peering route exists), while the Databricks cluster nodes land in subnets with a different route table that lacks the peering route.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #3: DNS RESOLUTION NOT ENABLED ON THE PEERING CONNECTION&lt;/P&gt;
&lt;P&gt;If you are connecting to your SQL Server by hostname (not IP), you need DNS resolution enabled on the VPC peering connection.&lt;/P&gt;
&lt;P&gt;How to verify:&lt;BR /&gt;1. Go to VPC Dashboard &amp;gt; Peering Connections&lt;BR /&gt;2. Select your peering connection&lt;BR /&gt;3. Go to Actions &amp;gt; Edit DNS Settings&lt;BR /&gt;4. Ensure "Allow DNS resolution from the remote VPC" is enabled on both sides&lt;/P&gt;
&lt;P&gt;You can test DNS resolution from a Databricks notebook:&lt;/P&gt;
&lt;P&gt;%sh host &amp;lt;your-sql-server-hostname&amp;gt;&lt;/P&gt;
&lt;P&gt;If the hostname doesn't resolve, this is your problem.&lt;/P&gt;
&lt;P&gt;Docs (Step 4): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #4: SECURE CLUSTER CONNECTIVITY (SCC) BEHAVIOR&lt;/P&gt;
&lt;P&gt;All new Databricks workspaces use Secure Cluster Connectivity by default, meaning cluster nodes have no public IP addresses. All outbound traffic goes through a NAT gateway. Verify that the NAT subnet's route table also has the correct peering route.&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;QUICK DIAGNOSTIC STEPS&lt;/P&gt;
&lt;P&gt;Run these from a Databricks notebook to pinpoint the issue:&lt;/P&gt;
&lt;P&gt;# Test DNS resolution&lt;BR /&gt;%sh host &amp;lt;sql-server-hostname&amp;gt;&lt;/P&gt;
&lt;P&gt;# Test TCP connectivity (port 1433 for SQL Server)&lt;BR /&gt;%sh nc -zv &amp;lt;sql-server-hostname-or-ip&amp;gt; 1433&lt;/P&gt;
&lt;P&gt;# Check the route table from the node's perspective&lt;BR /&gt;%sh ip route&lt;/P&gt;
&lt;P&gt;If "nc" times out but "host" resolves correctly, the problem is routing or security groups. If "host" fails, the problem is DNS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SUMMARY CHECKLIST&lt;/P&gt;
&lt;P&gt;- Security Group (SQL Server side): Inbound rule allows port 1433 from the Databricks Unmanaged SG ID&lt;BR /&gt;- Security Group (Databricks side): The Unmanaged SG allows outbound to the SQL Server VPC CIDR (should be allowed by default)&lt;BR /&gt;- Route Table (Databricks VPC): Peering route exists in the route table(s) actually associated with the cluster subnets -- not just the main route table&lt;BR /&gt;- Route Table (SQL Server VPC): Return route to Databricks VPC CIDR via the peering connection&lt;BR /&gt;- DNS Resolution: Enabled on the peering connection&lt;BR /&gt;- NACLs: Allow traffic in both directions on port 1433 (you mentioned these are OK)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;IS THE DATABRICKS-MANAGED VPC A LIMITATION?&lt;/P&gt;
&lt;P&gt;No, the Databricks-managed VPC supports VPC peering. The key difference is that you must use the Unmanaged security group (not the Managed one) when configuring access. If you ever need more control (PrivateLink, custom CIDR ranges, egress firewalls), you can consider a customer-managed VPC, but note that you cannot convert an existing workspace -- you would need to create a new one.&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DOCUMENTATION REFERENCES&lt;/P&gt;
&lt;P&gt;- VPC Peering with Databricks (full guide): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;BR /&gt;- Customer-Managed VPC: &lt;A href="https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html&lt;/A&gt;&lt;BR /&gt;- Secure Cluster Connectivity: &lt;A href="https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps narrow it down! The security group + Unmanaged SG issue is the most common root cause for this exact symptom pattern.&lt;/P&gt;
&lt;P&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Mar 2026 20:21:59 GMT</pubDate>
    <dc:creator>SteveOstrowski</dc:creator>
    <dc:date>2026-03-07T20:21:59Z</dc:date>
    <item>
      <title>Databricks cluster cannot reach SQL Server over VPC peering despite EC2 connectivity - AWS</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/149950#M53209</link>
      <description>&lt;P&gt;We are experiencing a networking issue where a Databricks cluster cannot connect to a SQL Server instance hosted in another VPC, even though connectivity from a regular EC2 instance works.&lt;BR /&gt;&lt;BR /&gt;Two EC2 instances deployed in the Databricks subnets (NatSubnet and ClusterSubnet) can successfully reach the database, confirming that VPC peering, routing tables, security groups, and NACLs are configured correctly. However, when a Databricks job runs on a cluster, connections to the same database time out.&lt;BR /&gt;&lt;BR /&gt;I am using default VPC created by Databricks within my AWS account and not customer-managed. Is this a limitation?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Mar 2026 03:33:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/149950#M53209</guid>
      <dc:creator>learti</dc:creator>
      <dc:date>2026-03-06T03:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks cluster cannot reach SQL Server over VPC peering despite EC2 connectivity - AWS</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/150095#M53239</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/218789"&gt;@learti&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;This is a very common scenario -- EC2 instances in the Databricks subnets can reach your SQL Server, but the Databricks cluster itself cannot. The good news is that VPC peering is fully supported with Databricks-managed VPCs, so this is NOT a fundamental limitation. The issue is almost certainly a configuration detail in one of the areas below.&lt;/P&gt;
&lt;P&gt;Here are the most likely causes, in order of probability:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #1: SECURITY GROUP MISCONFIGURATION (MOST LIKELY)&lt;/P&gt;
&lt;P&gt;When Databricks creates a managed VPC, it provisions two security groups:&lt;/P&gt;
&lt;P&gt;- A "Managed" security group (used internally by Databricks -- do NOT modify this)&lt;BR /&gt;- An "Unmanaged" security group (this is the one your cluster nodes actually use for outbound traffic)&lt;/P&gt;
&lt;P&gt;The key issue: Your SQL Server's security group needs an inbound rule that allows traffic from the Databricks "Unmanaged" security group -- not the Managed one, and not the subnet CIDR.&lt;/P&gt;
&lt;P&gt;How to fix:&lt;BR /&gt;1. In the AWS VPC Dashboard, find the security groups associated with your Databricks VPC&lt;BR /&gt;2. Identify the security group with "Unmanaged" in the name and copy its ID&lt;BR /&gt;3. Go to the security group attached to your SQL Server instance&lt;BR /&gt;4. Add an inbound rule: Custom TCP / Port 1433 / Source = the Unmanaged security group ID&lt;/P&gt;
&lt;P&gt;This is different from what you tested with EC2 instances. Your EC2 instances may have been using a different security group, or the SQL Server security group may allow traffic from the subnet CIDR but not from the Databricks Unmanaged security group specifically.&lt;/P&gt;
&lt;P&gt;Docs (Steps 7-8): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #2: ROUTE TABLE ASSOCIATION MISMATCH&lt;/P&gt;
&lt;P&gt;This is the second most common cause. The VPC peering documentation instructs you to add the peering route to the Databricks VPC's main route table. However, the subnets where Databricks cluster nodes actually run may be using custom (non-main) route tables instead of the main route table.&lt;/P&gt;
&lt;P&gt;How to verify:&lt;BR /&gt;1. Go to VPC Dashboard &amp;gt; Subnets and find the subnets in your Databricks VPC&lt;BR /&gt;2. For each subnet, check the Route Table tab -- note which route table is associated&lt;BR /&gt;3. If any subnet uses a route table other than the main route table, you need to add the peering route to THAT route table as well&lt;BR /&gt;4. The route should be: Destination = SQL Server VPC CIDR / Target = peering connection ID&lt;/P&gt;
&lt;P&gt;Your EC2 test instances may have been in a subnet that uses the main route table (where the peering route exists), while the Databricks cluster nodes land in subnets with a different route table that lacks the peering route.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #3: DNS RESOLUTION NOT ENABLED ON THE PEERING CONNECTION&lt;/P&gt;
&lt;P&gt;If you are connecting to your SQL Server by hostname (not IP), you need DNS resolution enabled on the VPC peering connection.&lt;/P&gt;
&lt;P&gt;How to verify:&lt;BR /&gt;1. Go to VPC Dashboard &amp;gt; Peering Connections&lt;BR /&gt;2. Select your peering connection&lt;BR /&gt;3. Go to Actions &amp;gt; Edit DNS Settings&lt;BR /&gt;4. Ensure "Allow DNS resolution from the remote VPC" is enabled on both sides&lt;/P&gt;
&lt;P&gt;You can test DNS resolution from a Databricks notebook:&lt;/P&gt;
&lt;P&gt;%sh host &amp;lt;your-sql-server-hostname&amp;gt;&lt;/P&gt;
&lt;P&gt;If the hostname doesn't resolve, this is your problem.&lt;/P&gt;
&lt;P&gt;Docs (Step 4): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;CAUSE #4: SECURE CLUSTER CONNECTIVITY (SCC) BEHAVIOR&lt;/P&gt;
&lt;P&gt;All new Databricks workspaces use Secure Cluster Connectivity by default, meaning cluster nodes have no public IP addresses. All outbound traffic goes through a NAT gateway. Verify that the NAT subnet's route table also has the correct peering route.&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;QUICK DIAGNOSTIC STEPS&lt;/P&gt;
&lt;P&gt;Run these from a Databricks notebook to pinpoint the issue:&lt;/P&gt;
&lt;P&gt;# Test DNS resolution&lt;BR /&gt;%sh host &amp;lt;sql-server-hostname&amp;gt;&lt;/P&gt;
&lt;P&gt;# Test TCP connectivity (port 1433 for SQL Server)&lt;BR /&gt;%sh nc -zv &amp;lt;sql-server-hostname-or-ip&amp;gt; 1433&lt;/P&gt;
&lt;P&gt;# Check the route table from the node's perspective&lt;BR /&gt;%sh ip route&lt;/P&gt;
&lt;P&gt;If "nc" times out but "host" resolves correctly, the problem is routing or security groups. If "host" fails, the problem is DNS.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;SUMMARY CHECKLIST&lt;/P&gt;
&lt;P&gt;- Security Group (SQL Server side): Inbound rule allows port 1433 from the Databricks Unmanaged SG ID&lt;BR /&gt;- Security Group (Databricks side): The Unmanaged SG allows outbound to the SQL Server VPC CIDR (should be allowed by default)&lt;BR /&gt;- Route Table (Databricks VPC): Peering route exists in the route table(s) actually associated with the cluster subnets -- not just the main route table&lt;BR /&gt;- Route Table (SQL Server VPC): Return route to Databricks VPC CIDR via the peering connection&lt;BR /&gt;- DNS Resolution: Enabled on the peering connection&lt;BR /&gt;- NACLs: Allow traffic in both directions on port 1433 (you mentioned these are OK)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;IS THE DATABRICKS-MANAGED VPC A LIMITATION?&lt;/P&gt;
&lt;P&gt;No, the Databricks-managed VPC supports VPC peering. The key difference is that you must use the Unmanaged security group (not the Managed one) when configuring access. If you ever need more control (PrivateLink, custom CIDR ranges, egress firewalls), you can consider a customer-managed VPC, but note that you cannot convert an existing workspace -- you would need to create a new one.&lt;/P&gt;
&lt;P&gt;Docs: &lt;A href="https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;DOCUMENTATION REFERENCES&lt;/P&gt;
&lt;P&gt;- VPC Peering with Databricks (full guide): &lt;A href="https://docs.databricks.com/en/security/network/classic/vpc-peering.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/vpc-peering.html&lt;/A&gt;&lt;BR /&gt;- Customer-Managed VPC: &lt;A href="https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/customer-managed-vpc.html&lt;/A&gt;&lt;BR /&gt;- Secure Cluster Connectivity: &lt;A href="https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html" target="_blank"&gt;https://docs.databricks.com/en/security/network/classic/secure-cluster-connectivity.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hope this helps narrow it down! The security group + Unmanaged SG issue is the most common root cause for this exact symptom pattern.&lt;/P&gt;
&lt;P&gt;* This reply used an agent system I built to research and draft this response based on the wide set of documentation I have available and previous memory. I personally review the draft for any obvious issues and for monitoring system reliability and update it when I detect any drift, but there is still a small chance that something is inaccurate, especially if you are experimenting with brand new features.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Mar 2026 20:21:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/150095#M53239</guid>
      <dc:creator>SteveOstrowski</dc:creator>
      <dc:date>2026-03-07T20:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks cluster cannot reach SQL Server over VPC peering despite EC2 connectivity - AWS</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/150404#M53412</link>
      <description>&lt;P&gt;Hey Steve, thanks a lot for the detailed reply.&lt;BR /&gt;&lt;BR /&gt;I was able to find the issue. The networking on AWS was configured correctly, however when I tried connection to the Database from Databricks I was using the Serverless, and I guess Databricks run them on their own infrastructure. However, then I noticed the "Compute" and from Compute I was able to reach my database.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Mar 2026 17:42:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-cluster-cannot-reach-sql-server-over-vpc-peering/m-p/150404#M53412</guid>
      <dc:creator>learti</dc:creator>
      <dc:date>2026-03-09T17:42:11Z</dc:date>
    </item>
  </channel>
</rss>

