Cosmos Provider
Developmentcosmos-providerCosmos Provider is an Agent Skill for development published in the dotnet/efcore repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
Implementation details for the EF Core Azure Cosmos DB provider. Use when changing Cosmos-specific code.
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/dotnet/efcore/blob/HEAD/.agents/skills/cosmos-provider/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/cosmos-provider, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
Cosmos DB Provider
Non-relational provider with its own parallel query pipeline. Uses JSON for document materialization.
Key Differences from Relational
- No migrations — use
EnsureCreated() - Documents as JSON — owned and complex types become embedded objects
- Partition key configuration required for performance
ETagfor optimistic concurrency- No cross-container joins
Azure Cosmos DB Emulator for Tests
TestEnvironment.InitializeAsync()auto-starts aTestcontainers.CosmosDbcontainer whenTest__Cosmos__DefaultConnectionis not set. Set the env var to use an existing emulator instead.- Skip tests requiring unsupported features on the Linux emulator with
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))].