Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Don-Bot
Helper V
Helper V

Create Fabric/Power BI Gateway Programmatically?

Is there a way I can create a power bi gateway programmatically, similar to how we can use xmla endpoints to create semantic models with code?  

 

I am looking for a way I could automate creating gateways in the service without having to do this manually.  I haven't found anything online yet about this so wanted to ask.


Edit:  What I'm referring to is after the on premise gateway is installed on the server and you setup the connection in power bi service.  I was wondering if I could setup that part programmatically

DonBot_0-1743083584684.png

 

1 ACCEPTED SOLUTION
v-sgandrathi
Community Support
Community Support

Hi @Don-Bot,

Happy to see you here in the Microsoft Fabric Community!

 

Currently, you cannot create a Power BI gateway programmatically using APIs; it must be manually installed and registered.

Install an on-premises data gateway | Microsoft Learn.

Once the gateway exists, you can automate managing data sources using the Power BI REST API.

Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn.

By  using these APIs, you can automate the management of data sources within your Power BI gateways, reducing the need for manual intervention.

Refer to the Microsoft documentation below for detailed information on the available endpoints.
Gateways - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!

 

Regards,
Sahasra.

 

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @Don-Bot,

Happy to see you here in the Microsoft Fabric Community!

 

Currently, you cannot create a Power BI gateway programmatically using APIs; it must be manually installed and registered.

Install an on-premises data gateway | Microsoft Learn.

Once the gateway exists, you can automate managing data sources using the Power BI REST API.

Gateways - Create Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn.

By  using these APIs, you can automate the management of data sources within your Power BI gateways, reducing the need for manual intervention.

Refer to the Microsoft documentation below for detailed information on the available endpoints.
Gateways - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

If this solution worked for you, kindly mark it as Accept as Solution and feel free to give a Kudos, it would be much appreciated!

 

Regards,
Sahasra.

 

Hi @v-sgandrathi  and @lbendlin ,I didn't mean install the gateway on premises.  I meant setup the connection in the Power BI Service.  

Actually @v-sgandrathi  in reading your reply I believe you may have the answer with create datasource.  I will try that out and get back to you (accept as solution or not)

Sorry for the confusion I'll edit my post

DonBot_0-1743083530196.png

 



Hi @Don-Bot,

 

I wanted to check in your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply as Accepted solution and give Kudos that helped you. It would be greatly appreciated by others in the community who may have the same question.

 

Thank you.

Hi @Don-Bot,

 

Since we haven't heard back from you yet, I'd like to confirm if you've successfully resolved this issue or if you need further help?
If you've already resolved the issue, you can mark the helpful reply as a "solution" so others know that the question has been answered and help other people in the community. Thank you again for your cooperation!
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.

 

Thank you.

lbendlin
Super User
Super User

Sounds like a VBI.

 

You would need to implement all the steps that follow the installation (proxy configuration, trusted sites, folder permissions, adding to cluster, logging in, installing all the drivers etc etc.)

 

What you could think of is to create a boilerplate image that has all this already configured, and then handle only the cluster addition programmatically.

 

And don't forget - if you delete the anchor member from the gateway then all the connections will go poof!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.