Forum Discussion
Copy data activity on microsoft fabric and mongodbAtlas problem connection
I'm trying to utilize the new MongoDB Atlas connector in Data Pipelines/Copy Data, but have had no luck at all connecting to my MongoDB Atlas database. It seems to be a connectivity issue or something wrong with my connect string. Can anyone help with the proper format on setting up atlas as a source?
>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 : [], DnsMonitorException : "DnsClient.DnsResponseException: Query 24306 => _mongodb._tcp.clustermarket.clustermarket.yvfht.mongodb.net IN SRV on 169.254.0.1:53 timed out or is a transient error. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at DnsClient.DnsUdpMessageHandler.Query(IPEndPoint server, DnsRequestMessage request, TimeSpan timeout)
at DnsClient.LookupClient.ResolveQuery(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit)
--- End of inner exception stack trace ---
at DnsClient.LookupClient.ResolveQuery(IReadOnlyList`1 servers, DnsQuerySettings settings, DnsMessageHandler handler, DnsRequestMessage request, LookupClientAudit audit)
at DnsClient.LookupClient.QueryInternal(DnsQuestion question, DnsQuerySettings queryOptions, IReadOnlyCollection`1 servers)
at MongoDB.Driver.Core.Misc.DnsClientWrapper.ResolveSrvRecords(String service, CancellationToken cancellationToken)
at MongoDB.Driver.Core.Clusters.DnsMonitor.Monitor()" }.
Thanks for your support
14 Replies
- AnonymousNot applicable
Hi BartoloIsmail ,
Thanks for using Fabric Community.Here are some steps to troubleshoot the connection and set up MongoDB Atlas as a source:
- Verify Connection String:
- Double-check your connection string for typos or incorrect formatting.
- Firewall Rules:
- Ensure your network allows outbound connections to MongoDB Atlas on port 27017 (or the custom port you might be using). Check your Data Pipelines service's network configuration and any firewalls in between.
Additional Tips:
Consider increasing the timeout value in your connection string using connectTimeoutMS parameter. This might help if there's a slight delay in establishing the connection.
Docs to refer - Configure MongoDB Atlas in a copy activity - Microsoft Fabric | Microsoft Learn
Hope this helps. Do let us know incase of further queries.- BartoloIsmailFrequent Visitor
Hi Anonymous ,
this morning I tried to input 00000. IP address in order to allow all access for everyone, and now I can conclude that it's Microsoft Fabric that doesn't want to connect. I have an internal error.
I found a similar message (https://community.fabric.microsoft.com/t5/Data-Pipelines/MongoDB-Atlas-Data-Copy-Connectivity/m-p/3566910) regarding the issue I'm facing. Let me explain: I'm trying to copy data via a pipeline using Microsoft Fabric to retrieve my MongoDB Atlas collection. I had an error that I corrected by adding a parameter that allows access to all IPs to access the MongoDB service. After running the test, I now encounter a new error that appears (progress... :)). I'm coming to you to ask if you could explain where this new error might be coming from. Thank you for your help.
- BartoloIsmailFrequent Visitor
Is there a way to deposit a JSON file into my bronze layer of my Microsoft Fabric lakehouse in a non-manual manner using a Talend job, for example, without using the MongoDB Atlas pipeline connectors or MongoDB Atlas SQL via Gen2 flows? I've noticed that there are SQL string connections available, but they seem only usable by tools like Power BI Desktop, for instance
- AnonymousNot applicable
Hi BartoloIsmail ,
You can use this SQL Connection String with following authentication methods.
Connectivity to data warehousing - Microsoft Fabric | Microsoft Learn
I also checked the possible connection options with Talend Cloud - List of supported connectors | Talend Cloud Data Preparation User Guide Help
You can also send your data to adls gen 2 and can pull it into lakehouse using fabric data factory.
If you like to connect with MongoDB Atlas, please follow this link - Configure MongoDB Atlas in a copy activity - Microsoft Fabric | Microsoft Learn
Hope this provided some insights. Do let me know incase of further queries.
- Verify Connection String:
- MarusykAdvocate II
I also have the problem with connection because by connection string must contain
&authmechanism=SCRAM-SHA-256&how can I specify it in Fabric? There are only server name + port and creds. How to specify an additional param?
- AnonymousNot applicable
Hi Marusyk ,
Thanks for using Fabric Community.
Can you explain me more about your issue? What are you trying to do?- MarusykAdvocate II
Hi, sure. I'm using the RBAC feature for CosmosDb. So I've created a user fabric and want to use it to connect from Fabric.
To connect to Cosmos using custom credentials use connection string like this (replace <username> and <password>):
mongodb://<username>:<password>@cosmos****-prod.mongo.cosmos.azure.com:10255/Customers?ssl=true&replicaSet=globaldb&authmechanism=SCRAM-SHA-256&retrywrites=false&maxIdleTimeMS=120000I got the error however the key is valid because I'm able to connect via MongoDB Compass