cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sreejiths
New Member

How to add a Service Principal as a Gateway Admin inorder to get a list of gateways using API ?

I need to get a list of all the Gateway clusters that is available in power bi portal. I went through the Rest Apis documentation(https://docs.microsoft.com/en-us/rest/api/power-bi/gateways/getgateway) and found that this API requires gateway admin permissions. I am using a Service Principal and have the permissions scope Gateway.ReadWrite.All & DataSet.ReadWrite.All set. 
From the Power Bi portal, it is not possible to add a Service Principal as a gateway admin. I tried the following steps and not able to succeed:

  1. Tried to add a service principal as an admin to the Gateway from the UI using the service principal name and object id, but it is not allowing and throwing error:
    These email addresses are invalid or duplicate: Service Principal Name
    Specify at least one email address
  2. Tried to create an AD group and added the Service Principal to that group and tried to add this group as an admin from the UI, but it is also not allowing and throwing the same error:
    Specify at least one email address

On further analysis, found the powershell cmdlet DataGateway. Using this cmdlet, I am able to create a new gateway cluster with Service Principal as an admin and this gateway cluster is getting listed in the Get Gateways api.

But, I am not able to add the Service Principal as an admin to existing gateways using this powershell cmdlets also.

Is this the only possible solution to add a Service Principal as an admin to a Gateway Cluster ?
Is there any option to add Service Principal as an admin user to an existing Gateway Cluster using this powershell script ?

Do we have any API to add the Service Principal as an admin to the existing Gateway Cluster ?

 

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @sreejiths ,

 

Within the Power BI Admin portal, we need to ensure that our Tenant settings allow service principals to use Power BI APIs. In addition, you can restrict access to the APIs through security groups.

For more details,please refer to:

https://www.serverlessnotes.com/docs/list-gateways-power-bi-rest-api 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @sreejiths ,

 

Within the Power BI Admin portal, we need to ensure that our Tenant settings allow service principals to use Power BI APIs. In addition, you can restrict access to the APIs through security groups.

For more details,please refer to:

https://www.serverlessnotes.com/docs/list-gateways-power-bi-rest-api 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

Thanks for the reponse. The tenant level developer settings for using SPN are already given and as I mentioned in the above description, I was able to list the gateways that are created using the Powershell cmdlet. My concern is regarding adding the SPN as an admin to the the gateways that exists already. 

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.