Cosmos Db
Description
Important Concepts
Configuration in DI (where to add)
// Infrastructure (example)
services.AddFlexCosmosDocumentStore<CustomerProfileDocument>(configuration);appsettings.json
{
"FlexBase": {
"DataStores": {
"Document": {
"CosmosDb": {
"Endpoint": "https://...documents.azure.com:443/",
"AccountKey": "<from-secrets>",
"DatabaseName": "{YourApplication}",
"ContainerName": "CustomerProfiles",
"PartitionKeyPath": "/id",
"ThroughputRUs": 400
}
}
}
}
}Examples (from the generated templates)
Handler example (Create)
Query example (Get-by-id)
Provider-specific considerations
Last updated