As Cosmos is MongoDB compatible, you can connect to it with a MongoDB client., with caveats.
The Dremio MongoDB source driver doesn’t actually have any flexibility to enable a connection.
What would be good would be one of the following in order of preference…
- Provide a native CosmosDB connector
or
- Allow a MongoDB connection string to be pasted in as an alternative to form field entries for the different sections.
For example, the following connection string should be enough , assuming Cosmos instance is called mydremiotestdb.documents.azure.com, where **** is the access key
Arguably, you hould just be able to paste in a mongo connection string anyway as an option.
mongodb://mydremiotestdb:******@mydremiotestdb.documents.azure.com:10255/mydatabase?ssl=true
Any update on the status?
Further update…
If Cosmos is deployed with Mongo API active, it would seem I can configure a connection of sorts… it would appear to validate the connection , but Dremio throws back a ‘no collections visible’ on trying to save the connection.
If anyone has a pointer/workaround , I’d appreciate. This seems close!
Another update…
Looking in the server.log, it does appear that Cosmos is being connected ok
The log looks like…
2021-12-03 09:30:50,204 [start-cosmos] INFO c.d.p.m.c.MongoConnectionManager - Created connection to [address:10255=xx.mongo.cosmos.azure.com, user=yy].
2021-12-03 09:30:50,204 [start-cosmos] INFO c.d.p.m.c.MongoConnectionManager - Number of open connections 1.
2021-12-03 09:30:50,204 [start-cosmos] INFO c.d.p.m.c.MongoConnectionManager - MongoCredential:MongoCredential{mechanism=null, userName=‘yy’, source=‘xx’, password=, mechanismProperties=}
2021-12-03 09:30:50,490 [start-cosmos] ERROR c.d.p.mongo.MongoDocumentHelper - Failed to run command Document{{usersInfo=Document{{user=yy, db=xx}}, showCredentials=false, showPrivileges=true}}
, exception : com.mongodb.MongoCommandException: Command failed with error 115 (CommandNotSupported): ‘Command usersInfo not supported.’ on server xx.mongo.cosmos.azure.com:10255. The full response is {“ok”: 0.0, “errmsg”: “Command usersInfo not supported.”, “code”: 115, “codeName”: “CommandNotSupported”}