Forum Discussion
Programmatically create a Power BI dataset with data source connections
- Anonymous1 year ago
Hi gb_asc,
Thank you for reaching out in Microsoft Community Forum.
Thank you Deku , lbendlin for the helpful response.
Please follow below steps to Programmatically create a Power BI dataset with data source connections;
1.Define your model with SQL Server as the source using the Microsoft.AnalysisServices.Tabular library.
2.Connect to the Power BI workspace using the XMLA endpoint and deploy the dataset.
3.Use the Power BI Admin REST API to set data source credentials after deployment (XMLA doesn't support credential input).
4. Make sure you authenticate with a gateway or service principal to securely manage credentials.
Please continue using Microsoft community forum.
If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.
Regards,
Pavan.
Push Datasets are an entirely different thing.
The usual approach is to prepare a template style PBIX, then upload that to the service and then change its data sources.
Imports - Post Import In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Datasets - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn
- Deku1 year agoSuper User
Push dataset are where you push rows into tables via the API for a realtime solution.
You could also look at using the pbip format and send to service with the fabric APIs