Fabric Notebook for Power BI: Deploying Semantic Models and Reports via REST APIs
Overview
This solution provides a streamlined approach to deploying Power BI Semantic Models and Reports from Development to Test and Production environments. It is designed to work seamlessly across:
- Same or different tenants
- Same or different subscriptions
Key Highlights
- Cross-Environment Compatibility: Works across tenants and subscriptions without additional complexity.
- Notebook-Driven Automation: Built for Fabric Notebooks, leveraging Python/PySpark for flexibility
- Reusable & Scalable: Adaptable for multiple workspaces and semantic models
How It Works
The following steps apply to a same-tenant scenario. For a cross-tenant setup—where the source workspace belongs to one tenant and the target workspace to another—you should first run the semantic model definition and report definition extraction in the source tenant workspace. Then, save the resulting definition JSON to a Lakehouse path in the target workspace. Finally, execute the deployment notebook from the target tenant, using the saved path to deploy both the semantic model and its associated report.
Steps
1) Required Inputs
- Semantic Model ID & Name (Source Environement)
- Report Id (Source Environement)
- Workspace ID & Name (Target Environment)
2) Execute the Notebook for Semantic Model Get definition
- Get the Definition of Existing Dev Semantic Model by Using Get Definition API
- Add the Model Definition Name and Descriptions in the definition json
- Save the Model Definition json in a path (optional)
3) Execute the Notebook for Semantic Model Deployment
- Use Create Semantic Model API With Model definition as request payload
- Use Long Running Operation APIs to get the status and result
- Get the Newly created Semantic Model Id for higher environment (Test or Prod)
4) Execute the Notebook for Report Get definition
- Get the Definition of Existing Dev Power BI Report by Using Get Definition API
- Add the Report Name and Descriptions in the definition json
- Save the Report Definition json in a path (optional)
5) Execute the Notebook for Report Deployment
- Use Create Report API With updated definition as request payload
- Use Long Running Operation APIs to get the status and result
The Semantic Model and Report are now available in the Test or Production workspace.
Full Notebook Code : Refer Here
https%3A%2F%2Fgithub.com%2Fjmytheen%2FJasmin_Work%2Fblob%2Fmain%2FDeploy_Semantic_Model_PowerBI_Report_Using_FabricRESTAPI.ipynb