Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All,
So, I have this requirement where I need to automate my dataflow refreshes and then finally a dataset which depends upon all the previous dataflows. Now, using a simple scheduled refresh does not solve the issue if one dataflow fails, then the remaining dataflows should not refresh.
Now the thing is, the Power Automate connector for dataflows is blocked by our client's IT team, so we cannot use that.
So, the next approach I explored was to use Power BI REST API to trigger a refresh, then get the refresh history using another API and continue the next steps as per 'Success' or 'Failed' status.
I found this very elaborate tutorial about using Power Query to call PBI API. (https://community.powerbi.com/t5/Community-Blog/Three-methods-to-get-refresh-history-of-Power-BI-dat...)
The next issue I stumbled upon is that our team is not allowed to register an app in Azure AD, hence we cannot obtain the Client ID and Client secret as used in the above link. Hence, without the client ID and client secret, I am unable to generate an authorization token. I tried writing M code without the Client ID and Secret as shown below but I got Error 400.
So, I searched for a method to consume PBI APIs without app registration. I found that using PowerShell scripting, we only need to use our Microsoft UserID and Password to log in to Power BI and consume APIs. Below is the code snippet that I found in StackOverflow.
We faced another issue here. That is scripting is blocked in our local system and also we do not have an Azure subscription, so we cannot use Azure Automation services to run this script.
Hence, my real question is,
Is it possible to write M code in a similar way as the above PowerShell code? To consume PBI APIs without app registration or is it only possible in PowerShell?
Apologies for the long post. This is only for others who may be stuck in a similar "Everything is blocked by IT" situation.
Thanks in advance!!
Update to this thread: -
As per my StackOverFlow screenshot, which says to input 'UserName' and 'Password'. I found that is not possible here. As per Microsoft Documentation, the '-credential' has to be used with '-ServicePrinciple' only. Hence, to use this method, we need to be able to register an app in AzureAD. And pass the Application ID and secret values in the username and password fields respectively. It works without any popup properly by using the ID and secret values.
Hi @SDM_1997 ,
Please review the following links, hope they can help you.
Custom connector: PowerBIRESTAPI
HOW TO GET DATA FROM POWER BI DATASET VIA AN API
REST API Power BI Integration: 2 Easy Methods (Method 2)
Best Regards
Hi!
Thanks for the reply. I will check the 1st option of using a custom connector once. But from what I understood from the GitHub link is that it can get refresh history but triggering a dataflow to start a refresh is not supported. Correct me if I am wrong and I missed that part.
2nd option is a simple use of a Web connector for connecting to an API. Calling power bi rest API does not work, since it does not support using organizational credentials input directly.
3rd option (2nd method) won't be possible for our case. The client won't allow buying a new software license. They have literally blocked Microsoft's own dataflow connectors, so any external software is out of the question. 😅
Thanks again!
So, it seems achieving the PowerShell feature of just using Username and Password is not possible for any other code platform.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
4 | |
4 | |
4 |