Home / Integrations / Azure Cosmos DB
Connect Azure Cosmos DB data to Salesforce Agentforce
Azure Cosmos DB is Microsoft's fully managed, globally distributed, multi-model database service — supporting document, key-value, graph, and column-family data models with single-digit millisecond latency at any scale. For enterprise applications built on Azure, Cosmos DB often serves as the primary operational database for customer data, application state, and event records that are separate from the Salesforce CRM. When a service agent needs to understand a customer's application state — their profile configuration, their subscription settings, their event history — that data is often in Cosmos DB rather than in Salesforce. When a commercial event in Salesforce requires a data record to be created or updated in the customer's operational database, Cosmos DB is the target. When Emerge Digital connects Cosmos DB to Agentforce, application and operational data from Cosmos DB is available to agents during service and commercial conversations — and Salesforce commercial events coordinate with Cosmos DB operations to keep the operational and commercial records aligned.
What this unlocks
- Customer profile and configuration context during service conversations: when a customer contacts support about their account settings, feature configuration, or subscription state, an agent can query the Cosmos DB container that holds the customer's operational profile — retrieving the specific configuration state relevant to the issue without the engineering team needing to run a database query.
- Event history and audit trail for account and service conversations: applications that log customer events to Cosmos DB — API calls, configuration changes, content interactions — give agents the ability to read a customer's recent activity during a service conversation, providing the operational context that informs the diagnosis rather than relying on summary data from the reporting layer.
- Salesforce commercial events trigger Cosmos DB customer record operations: when a Salesforce opportunity closes, a subscription is upgraded, or an account is offboarded, an agent can create or update the corresponding Cosmos DB customer record with the new subscription tier, feature entitlements, or offboarding state — so the operational database reflects the commercial decision without a manual engineering step.
- Multi-region database context for global enterprise accounts: Cosmos DB's global distribution allows reads from the nearest replica — an agent handling a global enterprise customer can query the Cosmos DB replica closest to the customer's region, returning the freshest local data rather than a cross-region read that introduces latency.
In the customer journey
Customer reports missing feature — agent checks Cosmos DB entitlement record
A customer contacts support reporting that a feature they purchased is not available in their account. The agent queries the Cosmos DB customer entitlement container — the feature entitlement is present but the activation_date field is set to tomorrow rather than today, because the billing cycle processed one day ahead of the entitlement activation workflow. The agent creates a Salesforce case for the engineering team to advance the activation date, and confirms the resolution timeline to the customer with the specific entitlement data.
Subscription upgrade in Salesforce updates Cosmos DB entitlement
A Salesforce opportunity closes for an enterprise tier upgrade. The agent reads the new entitlements from the Salesforce opportunity line items — increased API call limits, additional storage, and enterprise feature flags. The agent updates the customer's Cosmos DB entitlement document with the new tier configuration. The customer's application reflects the upgraded tier immediately rather than waiting for a nightly batch process.
Event history surfaces in a billing dispute
A customer disputes a billing charge for API calls in excess of their plan limit. The agent queries the Cosmos DB API event log container for the customer's account in the billing period. The query returns 47,891 API calls — 2,891 above the plan limit — with timestamps and endpoint details. The agent surfaces the specific overage data to the customer with the call timestamps, confirming the billing calculation is accurate.
Why not accessing Cosmos DB data through the application API?
Application APIs expose aggregated or processed data appropriate for customer-facing features. Raw customer profile configuration, audit event records, and entitlement state are often not exposed through the application API because they are internal operational data. Agentforce needs access to this internal state to diagnose configuration issues, verify entitlements, and confirm event history in service conversations. Emerge Digital builds the governed read layer that gives agents access to the specific Cosmos DB containers and documents relevant to commercial and service queries, without exposing the full database to the agent context.
Cosmos DB's Agentforce integration is most active in the service and account management stages for Azure-native enterprise applications — where customer operational data in Cosmos DB is the context agents need to diagnose service issues, verify entitlements, and understand customer state. It is part of a broader Azure integration for organisations building enterprise applications on the Microsoft Azure stack.
How Emerge integrates Azure Cosmos DB
Emerge Digital connects Cosmos DB to Salesforce Agentforce as a consulting engagement. We map which Cosmos DB containers and document types are relevant to commercial and service conversations, design the query layer for agent access with appropriate partition key and access scope controls, configure the Salesforce commercial event triggers that create and update Cosmos DB records, and set the governance boundaries around which agents can query which containers. The integration is designed around your Cosmos DB account structure and your Salesforce commercial model.
How we structure an engagementRelated integrations
FAQ
Can the agent create or modify Cosmos DB documents directly?
Pre-approved write operations — like updating a customer's entitlement document when a Salesforce deal closes — can be configured with defined scope and authorisation requirements. General-purpose Cosmos DB document creation or modification by agents requires an engineering team approval step for each operation type to prevent unintended data changes.
We use MongoDB or DynamoDB rather than Cosmos DB — can the same pattern work?
Yes. The operational database integration pattern — reading customer profile and event data during service conversations and writing commercial events back to the operational database — applies to MongoDB, DynamoDB, and other NoSQL databases. Emerge builds to the operational database your application uses.
Which Cosmos DB API does the integration use — Core (SQL), MongoDB API, or another?
Cosmos DB's Core (SQL) API is the most commonly integrated API and is the default for new applications. The integration can also work with the MongoDB API, Cassandra API, and Gremlin API depending on which API your application uses. Emerge designs the integration around the specific Cosmos DB API your containers use.
How long does a Cosmos DB + Agentforce integration take?
A focused engagement typically runs four to six weeks: mapping relevant Cosmos DB containers to Salesforce accounts, designing the query layer with partition key and access scope controls, configuring commercial event triggers for Cosmos DB operations, and testing service query, entitlement update, and event history retrieval scenarios.
Ground your agents in Azure Cosmos DB.
Tell us what your agents need to read and write in Azure Cosmos DB, and we'll design the integration and the governance around it.
Talk to the practicePrefer email? Write to the practice instead.