Skip to main content

Set Up Azure Cosmos DB for the EmpowerID Bot

The EmpowerID Chatbot leverages Azure Cosmos DB, a globally distributed NoSQL database, to store:

  • Chat conversations
  • Configuration settings
  • Adaptive Card templates

Using Cosmos DB ensures high performance, global scalability, and low-latency responses for bot operations.

Prerequisites

Before proceeding, ensure you have the following:

  • An active Azure subscription with permission to create and manage Cosmos DB and App Service resources.
  • Access to the EmpowerID Bot Service Deployment Package.
  • Permissions to modify App Service configuration and access Cosmos DB account keys.

Procedure

Step 1 – Create the Cosmos DB Instance

  1. Log in to the Azure Portal.
  2. Create a new Azure Cosmos DB account using the Core (SQL) API.
    • API selection is critical. Do not select other APIs (e.g., MongoDB, Cassandra). Create Cosmos DB

Step 2 – Create Database and Containers

  1. After provisioning the Cosmos DB account, open the account dashboard.

  2. Create a new database named:

    bot_database
  3. Within bot_database, create a container named:

    botconfig
    warning

    Important: Set the Partition key to /id when creating the container. This is required for correct query and performance behavior.

    New Container

  4. Create the following additional containers within the same bot_database:

    • conversations
    • templates

    Additional Containers

  5. After completing container creation, verify that all three containers (botconfig, conversations, templates) are listed under the bot_database. Container Listing

Step 3 – Upload Adaptive Card Templates

  1. Locate the EmpowerID Bot Service Deployment Package ZIP file:

    _BotServiceDeploymentPackage.zip
    info

    The deployment package is typically located at:
    EmpowerID\WFS\EmpowerID Product Packages\Mobile Manager\Microservice v3\

  2. Extract the ZIP contents and navigate to the Adaptive Card Templates folder.

  3. Upload all .json files from this folder into the templates container in Cosmos DB.

    Upload Templates
    Templates Uploaded

Step 4 – Update App Service Configuration

  1. In the Azure Portal, go to the App Service hosting the EmpowerID Bot.

  2. Under Settings > Configuration, add the following application settings:

    Setting NameValue
    CosmosDbAuthKeyPrimary Read-Write Key from Cosmos DB
    CosmosDbDatabaseIdbot_database
    CosmosDbContainerIdbotconfig
    CosmosDbEndpointURI of the Cosmos DB account (e.g., https://your-db.documents.azure.com:443/)
  3. Click Save to apply the new configuration.

Next Step

Next, you will configure Azure Key Vault to securely manage secrets and keys.