Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I am trying to figure out how we can update credentials for a power bi datasource in our gateway via the API only using powershell, we want to be able to automatically rotate credentials just running the powershell script.
In our testing we have had some sucess doing the following:
Solved! Go to Solution.
I"m running into some "timeout" issues when I submit for Encrypt credentials using that python app via localhost:5000. This is the error
Error retrieving Access token
HTTPSConnectionPool(host='login.microsoftonline.com', port=443): Max retries exceeded with url: /common/oauth2/v2.0/.well-known/openid-configuration (Caused by ConnectTimeoutError(, 'Connection to login.microsoftonline.com timed out. (connect timeout=None)'))
Not sure whats causing this..I will try to look at the .NET Core option today for encryption.
I am trying to implement this with OAUTH2. Is the flow for OAUTH2 similar to Basic Auth? Can you provide some pointers for OAUTH2 implementation?
I haven't tried it using OAUTH2, and we actually ended up switching over to doing it in python. But from some inital searching I imagine you could change the body to be like this:
$body = @{ "type" = "OAuth2", "typeProperties" = @{ "clientId" = "<client-id>", "clientSecret" = "<client-secret>", "tokenUrl" = "<token-url>", "resource" = "<resource>" } }
But I can't say for sure, sorry.
We're dealing with this encryption so that we can create a data source via API's I haven't had much luck with the API call. Were there any updates/improvements to this PowerShell Script? Please share any thoughts as we're trying to automate some of this process to extract password from our internal vault and call "Create datasource" API but it doesn't seem like its a simple call.
We abandonded the powershell script to use python instead, and I haven't done the create datasource, just rotating an existing one, sorry
Thanks Jared,
Are you able to share some documentation with Python process?
What I did was just based on this
https://github.com/microsoft/PowerBI-Developer-Samples/tree/master/Python
Here is a related blog, hoping to help you:
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
8 | |
6 | |
5 | |
2 | |
2 |
User | Count |
---|---|
4 | |
4 | |
3 | |
3 | |
2 |