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
Rajuvardhana
New Member

How to connect to the Self hosted mongoDB from Fabric.

I tried to integrate the self hosted MongoDB to fabric but im getting the error

 

Connection to MongoDB server is timeout.

A timeout occurred after 30000ms selecting a server using CompositeServerSelector{ Selectors = MongoDB.Driver.MongoClient+AreSessionsSupportedServerSelector, LatencyLimitingServerSelector{ AllowedLatencyRange = 00:00:00.0150000 }, OperationsCountServerSelector }. Client view of cluster state is { ClusterId : "1", Type : "Unknown", State : "Disconnected", Servers : [{ ServerId: "{ ClusterId : 1, EndPoint : "10.6.0.6:27017" }", EndPoint: "10.6.0.6:27017", ReasonChanged: "Heartbeat", State: "Disconnected", ServerVersion: , TopologyVersion: , Type: "Unknown", HeartbeatException: "MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.IO.IOException: Authentication failed because the remote party has closed the transport stream.

   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)

   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest, Boolean renegotiation)

   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)

   at MongoDB.Driver.Core.Connections.SslStreamFactory.CreateStream(EndPoint endPoint, CancellationToken cancellationToken)

   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)

   --- End of inner exception stack trace ---

   at MongoDB.Driver.Core.Connections.BinaryConnection.OpenHelper(CancellationToken cancellationToken)

   at MongoDB.Driver.Core.Connections.BinaryConnection.Open(CancellationToken cancellationToken)

   at MongoDB.Driver.Core.Servers.ServerMonitor.InitializeConnection(CancellationToken cancellationToken)

   at MongoDB.Driver.Core.Servers.ServerMonitor.Heartbeat(CancellationToken cancellationToken)", LastHeartbeatTimestamp: "2026-01-09T06:40:09.7412433Z", LastUpdateTimestamp: "2026-01-09T06:40:09.7412433Z" }] }.

 

Activity ID: 05b51939-ba6c-471e-8a17-0b541569b176"

1 ACCEPTED SOLUTION

Hi @Rajuvardhana ,

You are already following the correct Microsoft documentation for connecting a self-hosted MongoDB to Microsoft Fabric using a Copy Job. That document accurately describes the supported setup and prerequisites.

Based on this guidance, Microsoft Fabric requires secure (TLS/SSL) connectivity when accessing MongoDB through the On-premises Data Gateway. In your current setup, TLS is not enabled on the MongoDB server, which causes the connection handshake to fail and results in the timeout error you are seeing.

 

To successfully connect, TLS must be enabled on the MongoDB server, a certificate must be configured (a self-signed certificate is acceptable), and the certificate must be trusted on the gateway machine. After this, the MongoDB connection should be configured with SSL enabled in the Fabric Copy Job.

 

Without enabling TLS on MongoDB, Fabric will not be able to establish a connection, even if the gateway is correctly installed and running.

Best Regards, 
Community Support Team

View solution in original post

5 REPLIES 5
Rajuvardhana
New Member

Yes, We have installed the gateway and TLS is not enabled on the Server.

 

Guide me to connect Self hosted MongoDB to fabric, we are using Copy Job in Fabric.

 

https://learn.microsoft.com/en-us/fabric/data-factory/connector-mongodb-copy-activity

Hi @Rajuvardhana ,

You are already following the correct Microsoft documentation for connecting a self-hosted MongoDB to Microsoft Fabric using a Copy Job. That document accurately describes the supported setup and prerequisites.

Based on this guidance, Microsoft Fabric requires secure (TLS/SSL) connectivity when accessing MongoDB through the On-premises Data Gateway. In your current setup, TLS is not enabled on the MongoDB server, which causes the connection handshake to fail and results in the timeout error you are seeing.

 

To successfully connect, TLS must be enabled on the MongoDB server, a certificate must be configured (a self-signed certificate is acceptable), and the certificate must be trusted on the gateway machine. After this, the MongoDB connection should be configured with SSL enabled in the Fabric Copy Job.

 

Without enabling TLS on MongoDB, Fabric will not be able to establish a connection, even if the gateway is correctly installed and running.

Best Regards, 
Community Support Team

Hi @Rajuvardhana ,

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

Best Regards, 
Community Support Team 

valentinbauer
Microsoft Employee
Microsoft Employee

Fabric can’t connect directly to a self‑hosted MongoDB if you don't have an On‑premises Data Gateway. 

The error you’re seeing is usually a certificate issue:

  • MongoDB is using TLS, but the certificate isn’t trusted by the gateway machine, or
  • TLS versions don’t match (Fabric/gateway expects TLS 1.2).

Check:

  • Gateway is installed and running
  • MongoDB certificate chain is valid and trusted on the gateway host
  • TLS 1.2 is enabled on MongoDB

Once gateway + TLS are correct, the connection should work.

If you found this guidance useful, you are welcome to acknowledge with a Kudos or by marking it as a Solution !

Hi @Rajuvardhana ,

Thanks for reaching out to the Microsoft fabric community forum. 

 

I would also take a moment to thank  @valentinbauer  , for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.

I hope the above details help you fix the issue. If you still have any questions or need more help, feel free to reach out. We’re always here to support you .

 

Best Regards, 
Community Support Team 

 

Helpful resources

Announcements
FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

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.

March Fabric Update Carousel

Fabric Monthly Update - March 2026

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