1
votes

I have implemented custom state data store with Azure Cosmos DB as instructed in here - Manage custom state data with Azure Cosmos DB

It works fine. The azure extension has created a db called 'botdb' and a collection called 'botcollection' in my Cosmos DB endpoint.

Is there anyway that i can change the db name from 'botdb' to something else?

Otherwise i am able to store state data, only for one bot in one Cosmos DB endpoint. I am planning to store state data for multiple bots in same Cosmos DB endpoint.

Will i have to manually implement IBotDataStore?

1
I'm not sure about DocumentDbUri formats, can't you specify dbname inside? - Nicolas R

1 Answers

1
votes

You can pass in the database name and the collection name while creating your store:

var store = new DocumentDbBotDataStore(uri, key, "dbname","collectionname");

If you look at the constructor of DocumentDbBotDataStore, 'botdb' and 'botcollection' are added as default values,

public DocumentDbBotDataStore(Uri serviceEndpoint, string authKey, string databaseId = "botdb", string collectionId = "botcollection");

That's the reason azure extension had created a db called 'botdb' and a collection called 'botcollection' in your Cosmos DB endpoint.