4

I am having trouble connecting my Azure CosmosDB to MongoDB Compass. I need clarification and assistance with the following settings:

  • Authentication = username and password from connection string?
  • Authentication Database = my CosmosDB database?
  • Replica Set Name?
  • Read Preference = Primary?
  • SSL?
  • SSH Tunnel?
Stennie
  • 63,885
  • 14
  • 149
  • 175
Brian Pace
  • 135
  • 1
  • 13

1 Answers1

7

Cosmos DB uses Username/Keys instead of Username/Password authentication. In the Azure Portal for your Azure Cosmos DB instance, under Settings > Connection String, you will see your Connection Strings. It's all there:

enter image description here

Primary Connection String Example: mongodb://miubezzi-mongoapi:'Read-write Key'@miubezzi-mongoapi.documents.azure.com:10255/?ssl=true&replicaSet=globaldb

With the following Compass Connect information, I was able to connect. My Compass instance is currently syncing but I am connected. Will update with addition details.

enter image description here

enter image description here

And I am able to create a Database + Collection via Compass.

enter image description here

Mike Ubezzi
  • 1,007
  • 6
  • 8
  • this is only valid for CLI mongodb though? I am posting regarding CosmosDB Compass here – Brian Pace Nov 28 '18 at 20:00
  • 1
    Let me take a look. I am seeing a bug: https://jira.mongodb.org/browse/COMPASS-2990 – Mike Ubezzi Nov 28 '18 at 21:12
  • So I'm guessing until the bug gets resolved (which they won't), one cannot access the data within mongodb hosted on azure cosmosdb? I arrived at the stage where Compass keeps on trying to load the data too. – Brian Pace Nov 29 '18 at 15:54
  • Let me reach out to the product group and get you some additional information. – Mike Ubezzi Nov 29 '18 at 17:11
  • In the meantime, I see that this is not an existing ask on the Cosmos DB User Voice: https://feedback.azure.com/forums/263030-azure-cosmos-db Please make an entry there, as I know the product group is going to redirect me there first. I already have a communication out to them. I need you to make a feature request on the User Voice. Thank you! – Mike Ubezzi Nov 29 '18 at 17:22
  • Same here. I have created the User Voice entry, as @MikeUbezziMSFT suggested: https://feedback.azure.com/forums/263030-azure-cosmos-db/suggestions/36349687-compass-connection-not-showing-documents-but-all – rafamontoya Dec 21 '18 at 11:07
  • The User Voice entry is the correct channel for this feature request. I have sent an email to the product group but they are not going to respond. The User Voice forum is the best method for this ask. Thank you! – Mike Ubezzi Dec 21 '18 at 18:01