Skip to content

Fix Cosmos indexing paths for latest emulator#10084

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rebond/cosmos-indexing-path-compat
May 12, 2026
Merged

Fix Cosmos indexing paths for latest emulator#10084
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rebond/cosmos-indexing-path-compat

Conversation

@ReubenBond

@ReubenBond ReubenBond commented May 9, 2026

Copy link
Copy Markdown
Member

Problem

Newer Linux Cosmos emulator builds reject non-root wildcard paths in indexing policy exclusions such as /StartAt/*, /Address/*, and /"State"/*. That prevents new Cosmos containers from being created in the reminders, clustering, and persistence providers.

Solution

Update known scalar fields to use terminal scalar paths (/?), update scalar array exclusions to use /[]/?, and change the grain storage container policy to exclude root while including metadata and configured StateFieldsToIndex paths. This follows the Cosmos indexing policy docs for scalar and array paths while preserving the existing opt-in state indexing behavior.

Docs: https://learn.microsoft.com/en-us/azure/cosmos-db/index-policy#including-and-excluding-property-paths

Reviewer focus

Please look closely at CosmosGrainStorage's excluded-root policy, since it replaces the prior recursive State exclusion without broadening default State indexing.

Microsoft Reviewers: Open in CodeFlow

Use scalar and array terminal index paths in Cosmos indexing policies so newer emulator builds accept provider container creation.

Keep grain state indexing opt-in by switching the persistence provider to an excluded-root policy with explicit metadata and configured state field includes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ReubenBond ReubenBond force-pushed the rebond/cosmos-indexing-path-compat branch from 979cea6 to 2a02bf5 Compare May 12, 2026 20:53
@ReubenBond ReubenBond enabled auto-merge May 12, 2026 20:53
@ReubenBond ReubenBond added this pull request to the merge queue May 12, 2026
Merged via the queue into dotnet:main with commit 9d87ec9 May 12, 2026
62 checks passed
@ReubenBond ReubenBond deleted the rebond/cosmos-indexing-path-compat branch May 12, 2026 21:56
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant