Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Latest commit

 

History

History

DocumentDb

Azure DocumentDB Sample

This simple echo bots illustrates how to use your own Azure DocumentDB to store the bot state.

To use DocumentDB Store, we configure the Autofac Dependency Injection in Global.asax. Particularly the following is the piece of code that configures injection of DocumentDB:

var store = new DocumentDbBotDataStore(docDbEmulatorUri, docDbEmulatorKey);
builder.Register(c => store)
    .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
    .AsSelf()
    .SingleInstance();

Note that instead of passing docDbEmulatorUri, docDbEmulatorKey, real Azure DocumentDB credentials can be passed to configure an Azure DocumentDB account.