Querying with resource token and the first level of a 2-level hierarchical partition key results in a 403 Forbidden #4099
Labels
customer-reported
Issue created by a customer
HierarchicalPartitioning
Tag to track issues related to Hierarchical Partitioned containers
Service Bug
The issue is created because of a Cosmos DB service bug.
This issue was first described here AzureCosmosDB/HierarchicalPartitionKeysFeedbackGroup#14 by @idg10 but the feedback group looks abandoned.
Description
Querying data on a container having a 2-level hierarchical partition key (like
/customerName/documentId
) with aCosmosClient
created with a resource token based on a single level permission (
/customerName
) results with a 403 Forbidden.Repro
Create a container with a 2-level hierarchical partition key.
Insert test data using Azure Portal UI.
Create a user and a permission for the first level of the hierarchical partition key.
Instantiate a
CosmosClient
using the permission.Query the data using the
CosmosClient
.Expected behaviour
Documents having
customerName
equal to"unity"
are logged to the console.Actual behaviour
feed.ReadNextAsync()
throws aCosmosException
with messageStack trace below.
I noticed I get the same result when I don't provide
QueryRequestOptions
at all or when I try with a LINQ +.ToFeedIterator()
.Environment
SDK Version: 3.35.4
Stack trace
The text was updated successfully, but these errors were encountered: