Forum Discussion
Adding service principal (App registrations) to to data source users
Hi! I am using REST API to add service principal (App registrations) to to data source users. (documentaion: https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/add-datasource-user)For autentication I am using AccessToken generated for PowerBI Service principals with granted permission:
Here is a PowerShell code which I use to add Service Princpal to datasoource users
4 Replies
- lbendlin
Super User
does it work when you do that in the gateway management center webpage?
- AnonymousNot applicable
No, it doesn't. I can't add manually service principal to datasource users on GUI.
It wokrs when I use PowerShell 7 with DataGateway module (Install-Module -Name DataGateway, require PowerShell higher than 6.2.2) and when I run connect commands: Connect-PowerBIServiceAccount and Login-DataGatewayServiceAccount (tested by using user account, not as a service prinipal - app registration). Do we have any solution for PowerShell 5.1? Is it necessary to authenticate by uisng Login-DataGatewayServiceAccount ?
- V-lianl-msft
Community Support
Hi Anonymous ,
Please check if you have given the appropriate values for the parameters applied in command:
-GatewayClusterId
-GatewayClusterDatasourceId
-Identifier : provide the object id of service principal
You can also refer to this video:
https://www.youtube.com/watch?v=lfP6ygindSU
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
V-lianl-msft I have checked all parameter. They are correct. Do you have any advise what can I chcek else?