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
- Log in to the Azure Portal.
- 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).
- API selection is critical. Do not select other APIs (e.g., MongoDB, Cassandra).
Step 2 – Create Database and Containers
-
After provisioning the Cosmos DB account, open the account dashboard.
-
Create a new database named:
bot_database
-
Within
bot_database
, create a container named:botconfig
warningImportant: Set the Partition key to
/id
when creating the container. This is required for correct query and performance behavior. -
Create the following additional containers within the same
bot_database
:conversations
templates
-
After completing container creation, verify that all three containers (
botconfig
,conversations
,templates
) are listed under thebot_database
.
Step 3 – Upload Adaptive Card Templates
-
Locate the EmpowerID Bot Service Deployment Package ZIP file:
_BotServiceDeploymentPackage.zip
infoThe deployment package is typically located at:
EmpowerID\WFS\EmpowerID Product Packages\Mobile Manager\Microservice v3\
-
Extract the ZIP contents and navigate to the Adaptive Card Templates folder.
-
Upload all
.json
files from this folder into thetemplates
container in Cosmos DB.
Step 4 – Update App Service Configuration
-
In the Azure Portal, go to the App Service hosting the EmpowerID Bot.
-
Under Settings > Configuration, add the following application settings:
Setting Name Value CosmosDbAuthKey
Primary Read-Write Key from Cosmos DB CosmosDbDatabaseId
bot_database
CosmosDbContainerId
botconfig
CosmosDbEndpoint
URI of the Cosmos DB account (e.g., https://your-db.documents.azure.com:443/
) -
Click Save to apply the new configuration.
Next Step
Next, you will configure Azure Key Vault to securely manage secrets and keys.