Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
9 | |
4 | |
3 | |
2 | |
2 |