Azure-Samples / CosmosDB-Flask-Mongo-Sample

Sample Flask App using Azure Cosmos DB for MongoDB API
MIT License
15 stars 19 forks source link

How can I connect to existing Azure CosmosDB #4

Open HoLue opened 4 years ago

HoLue commented 4 years ago

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Question

From Azure CosmosDB I have the connection string. I don't know what I have to write as values for the different arguments in these lines

client = MongoClient("mongodb://127.0.0.1:10250/?ssl=true") #host uri
db = client.test    #Select the database
db.authenticate(name="localhost",password='C2y6yDjf5' + r'/R' + '+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw' + r'/Jw==')

For example, I have the connecteion string 'abc...'. Where must I write it? What shall I use for/as

Please help!

LuisBosquez commented 4 years ago

Hello @HoLue! you can find these values in the Keys blade on your account's Azure Portal. The host URI is the Cosmos DB endpoint specified for your account. This window should also provide your unique username and password.