Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I'm working on a Release pipeline in DevOps. I'm using the Power BI Actions to publish the pbix to a workspace and that's working fine. I then need to take ownership, update a parameter in the report and refresh the data. I can't use the Power BI Actions TakeOwnership, UpdateParameters & DataRefresh because you have to hard-code the Dataset name. I checked with the guy who wrote these and he said right now this is how it is written - you can't even use a pipeline variable. I'm using a service principal for the Power BI service connection and that's working.
Using Powershell I'm able to take ownership and update the parameter. The problem is after taking ownership the gateway connection is missing. In fact, if I do it through the website I get the same problem - take ownership, try to refresh and get this error, "Refresh failed because this dataset requires a gateway. Please select a gateway from dataset settings.". I CAN go to the Gateway connection, update the connection and then all is fine.
I have the MicrosoftPowerBIMgmt module installed.
I found this great video from Guy in a Cube about doing this: Refresh your data in Power BI WITHOUT a user??? - YouTube. Here he says I have to add the Service Principal as an Administrator of the gateway. When I follow his steps to do this using Powershell 7 I get this error doing Add-DataGatewayClusterDatasourceUser:
Add-DataGatewayClusterDatasourceUser: Response status code does not indicate success: 404 (Not Found) ErrorCode: ADGraphEntityOperationFailedResourceNotFound
Anyone have any suggestions what I need to do to update a parameter in the report and refresh the dataset? Thanks!
Solved! Go to Solution.
Hi @Richtpt ,
First of all, make sure you have created the service principal object, if not, please refer to the following links to create it.
Embed Power BI content with service principal and an application secret
Power BI Service Principals 101
Step 1 - Create an Azure AD app
Step 2 - Create an Azure AD security group
Step 3 - Enable the Power BI service admin settings
Step 4 - Add the service principal to your workspace
I watched the video that you mentioned. When the blogger used Powershell to add the service principal as data source user, he used his own gateway admin account to log in and executed the command Add-DataGatewayClusterUser.
Besides that, please check if you have given the appropriate values for the parameters applied in below command:
-GatewayClusterId
-GatewayClusterDatasourceId
-Identifier : provide the object id of service principal
Object ID:
Best Regards
Hi @Richtpt ,
First of all, make sure you have created the service principal object, if not, please refer to the following links to create it.
Embed Power BI content with service principal and an application secret
Power BI Service Principals 101
Step 1 - Create an Azure AD app
Step 2 - Create an Azure AD security group
Step 3 - Enable the Power BI service admin settings
Step 4 - Add the service principal to your workspace
I watched the video that you mentioned. When the blogger used Powershell to add the service principal as data source user, he used his own gateway admin account to log in and executed the command Add-DataGatewayClusterUser.
Besides that, please check if you have given the appropriate values for the parameters applied in below command:
-GatewayClusterId
-GatewayClusterDatasourceId
-Identifier : provide the object id of service principal
Object ID:
Best Regards
AH! I was using the wrong Object ID! I should have paid better attention to the video. Thanks very much for pointing that part out! 🙂
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |