Here are some ideas to try to troubleshoot this issue. It's possible that:
- The collection is empty;
- There are no documents that contain PartitionKey name;
- That you meant to query the document partition key, which may be different than /PartitionKey for example;
--- Querying and Inspecting Documents ---
You can query the documents in a collection in the Azure Portal, navigate to the CosmosDB/SQL Account > Data Explorer > {Database Name} > {Collection Name} > New SQL Query. Then, run query experiments there and view all (paged) documents as well.
--- Find the Partition Key ---
You can double check the collection partition key in the Azure Portal as well, navigate to the CosmosDB/SQL Account > Data Explorer > {Database Name} > {Collection Name} > Scale & Settings and check the what is defined on the Partition Key field (e.g. /customerid, /name, etc.).
As an example, considering the partition key is defined as /customerid, the query will look like:
SELECT c.customerid FROM c
Or the following query in case /customerid is not the partition key and may have duplicates:
SELECT DISTINCT c.customerid FROM c