Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
lherbert501
Post Partisan
Post Partisan

SQL TDS Endpoint Connector

Hi,

 

I'm attempting to connect to a TDS Endpoint (Dataverse) read only sql database. I've done my query and put it into power bi.

 

This refreshes fine locally but gives me below when I'm attempting to refresh on the gateway/service.

 

Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server

 

How could it be the correct server locally and not on the service?

 

Thanks

 

 

1 ACCEPTED SOLUTION
Lodha_Jaydeep
Resolver II
Resolver II

Hi @lherbert501,

Thanks for reaching fabric commuinity. will always happy to answer. It seems issue with the connection configuration for this endpoint. Can you please look at below things.

 

Why it works locally but not on the service

When you refresh locally, Power BI Desktop uses your machine's credentials and network directly. When refreshing via the Power BI Service/Gateway, it routes through the gateway machine, which has a different network context.

Root Causes & Fixes

 

  1. Gateway is using Named Pipes instead of TCP/IP

The error explicitly says Named Pipes Provider, error: 40. The gateway needs to connect via TCP/IP, not Named Pipes.

  • On the gateway machine, open SQL Server Configuration Manager
  • Enable TCP/IP under SQL Server Network Configuration
  • Disable or deprioritize Named Pipes

 

  1. The Dataverse TDS Endpoint URL must be used correctly

For Dataverse, your connection string should use the org's TDS endpoint URL format:

Ex- yourenvironment.crm.dynamics.com, 5558

Make sure the gateway machine can resolve and reach this hostname on port 5558.

 

  1. Firewall on the gateway machine

The gateway server may be blocking outbound port 5558. Verify that:

  • Port 5558 is open outbound on the gateway machine
  • No corporate firewall is blocking it

 

  1. Gateway credentials / authentication

Dataverse TDS requires Azure AD (OAuth) authentication. In Power BI Service, go to:

Dataset Settings → Data source credentials → Edit credentials → Set authentication to OAuth2

 

  1. On-premises Data Gateway version

Ensure your gateway is up to date, older versions had known issues with Dataverse TDS. Download the latest from Microsoft.

 

Quick checklist

Check

Action

Port 5558 open on gateway?

Test with telnet yourenvironment.crm.dynamics.com 5558

OAuth2 set in Power BI Service?

Dataset → Settings → Credentials

Gateway updated?

Download latest version

TCP/IP enabled on gateway machine?

SQL Server Config Manager / Please try to connect the SQL read
only endpoint from the Gateway machine (SSMS Connection Test)

 

The most common fix for this specific error is setting OAuth2 credentials in the Power BI Service for the Dataverse data source.

Hope these can help to fix your issue. Please consider this post as eccepted solution if helps.

 

View solution in original post

2 REPLIES 2
Lodha_Jaydeep
Resolver II
Resolver II

Hi @lherbert501,

Thanks for reaching fabric commuinity. will always happy to answer. It seems issue with the connection configuration for this endpoint. Can you please look at below things.

 

Why it works locally but not on the service

When you refresh locally, Power BI Desktop uses your machine's credentials and network directly. When refreshing via the Power BI Service/Gateway, it routes through the gateway machine, which has a different network context.

Root Causes & Fixes

 

  1. Gateway is using Named Pipes instead of TCP/IP

The error explicitly says Named Pipes Provider, error: 40. The gateway needs to connect via TCP/IP, not Named Pipes.

  • On the gateway machine, open SQL Server Configuration Manager
  • Enable TCP/IP under SQL Server Network Configuration
  • Disable or deprioritize Named Pipes

 

  1. The Dataverse TDS Endpoint URL must be used correctly

For Dataverse, your connection string should use the org's TDS endpoint URL format:

Ex- yourenvironment.crm.dynamics.com, 5558

Make sure the gateway machine can resolve and reach this hostname on port 5558.

 

  1. Firewall on the gateway machine

The gateway server may be blocking outbound port 5558. Verify that:

  • Port 5558 is open outbound on the gateway machine
  • No corporate firewall is blocking it

 

  1. Gateway credentials / authentication

Dataverse TDS requires Azure AD (OAuth) authentication. In Power BI Service, go to:

Dataset Settings → Data source credentials → Edit credentials → Set authentication to OAuth2

 

  1. On-premises Data Gateway version

Ensure your gateway is up to date, older versions had known issues with Dataverse TDS. Download the latest from Microsoft.

 

Quick checklist

Check

Action

Port 5558 open on gateway?

Test with telnet yourenvironment.crm.dynamics.com 5558

OAuth2 set in Power BI Service?

Dataset → Settings → Credentials

Gateway updated?

Download latest version

TCP/IP enabled on gateway machine?

SQL Server Config Manager / Please try to connect the SQL read
only endpoint from the Gateway machine (SSMS Connection Test)

 

The most common fix for this specific error is setting OAuth2 credentials in the Power BI Service for the Dataverse data source.

Hope these can help to fix your issue. Please consider this post as eccepted solution if helps.

 

DanieleUgoCopp
Responsive Resident
Responsive Resident

Hello
I’m not completely sure, but this usually happens when the gateway can’t reach the same endpoint your local machine can, even if it works fine on your side, often it’s a network or DNS issue rather than the query itself. I’d check if the gateway machine can resolve and access the TDS endpoint, maybe try connecting from that server directly, also verify firewall rules, ports, and that the connection is using the right auth method in the service, sometimes switching from named pipes to TCP/IP or using the full server URL helps. If it’s Dataverse, also double check that TDS is enabled and allowed for external connections, and that the gateway is updated.

Best regards,
Daniele

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.