Forum Discussion
How to securely store and use token and secret for API request in Power Query M ?
- 3 years ago
Oh, sorry about that... didn't realize that POST didn't support authentication in Web.Contents. I don't know any use of keyvault, and you would likely run into the same issues you face here using it.
I think the only option you would have is to write your own connector, which is given much more freedom on how it operates. Note, that if you write your own connector you cannot publish your report online unless you use a gateway (in which case you might as well just store the secret on the gateway machine and configure access to that speratly). Also, note that this does not work with importing data into Excel.
See this PowerBI - Power Query Fetch credentials from Azure Vault - Stack Overflow.
We implemented this one using AKV and a sharepoint folder. 🙂
You are using PQ to hit a REST endpoint. At this level of complexity, doing a py server to broadcast a token is insane.
Also, for anyone reading this in 2025+ = just use Fabric.