Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 ...
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.