Forum Discussion

gb_asc's avatar
gb_asc
Frequent Visitor
1 year ago
Solved

Programmatically create a Power BI dataset with data source connections

Hi all,   I am trying to create a power bi dataset through Python or C# (TOM library).  The goal is to: 1) Create a power bi dataset with SQL Server as the source. Attach the datasource connetci...
  • Anonymous's avatar
    Anonymous
    1 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.