Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
For performance reasons I like to select documents from the DocumentDB belonging to a single partionkey - thus a list of partionkeys is essential. I have noticed that there is a REST API available, using a URL like
https://<database>.documents.azure.com:443/dbs/<databaseid>/colls/<collectionid>/pkranges (see https://docs.microsoft.com/nl-nl/rest/api/cosmos-db/get-partition-key-ranges)
Said that I tried this, getting through the hurdle of setting the appropriate authorization header which I think I have figured out. It is something like type=master&er=1.1&sig=<read-only primary key>.
This all results in the following query (Advanced Editor)
let Source = Json.Document(Web.Contents("https://<database>.documents.azure.com:443/dbs/<databaseid>/colls/<collectionid>/pkranges", [Headers=[authorization="type=master&ver=1.0&sig=<read-only primary key>"]])) in Source
Unfortunately all I get is a returncode 400 (Bad Request) with the explaination "Web.Contents failed to get contents ... ".
Is the above a road to succes? Or do I miss something?
Using the RESTED Firefox extension I figured out that I missed two required headers ... x-ms-version and x-ms-date. Now I fail with the authorization token getting a 401 as response. More for research ...
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.