Forum Discussion
Fabric - Sonar Scan
Hello,
In our organization we use Fabric and we have following environments: DEV, TEST, PREPROD, PROD.
In DEV and TEST we are integrated with Git, so we have a repository with data pipelines, notebooks ...
I was thinking about which possibilities there are for Fabric items in Git to be scanned.
I know that probably a notebook written in Python can be scanned in Sonar, then Data Pipelines are json files so maybe yes ... what else? There is some feasability on do that?
Regards
1.Python Notebooks:
-
If your Fabric notebooks use Python, SonarQube can scan them like normal .py files.
-
Export notebooks from Fabric to Git before scanning.
2.Data Pipelines (JSON):
-
Pipelines are saved as JSON in Git.
-
Sonar can read JSON but only checks structure ,it can’t validate pipeline logic.
3.SQL Scripts:
-
Sonar supports T-SQL and other SQL code, so you can scan Fabric SQL scripts for best practices and syntax issues.
4.Other Fabric Items:
-
Dataflows, Lakehouses, and Datasets are metadata-based ,Sonar can’t analyze them yet.
5.CI/CD Integration:
-
You can run Sonar scans automatically in your Azure DevOps or GitHub pipeline after every commit.
Conclusion:
SonarQube works well for Python notebooks and SQL scripts, gives limited checks for JSON pipelines, and doesn’t yet support Lakehouse or Dataflows.Integrating it with your Fabric Git repo is the best way to maintain consistent code quality and CI/CD governance.
-
3 Replies
- rohit1991Super User
1.Python Notebooks:
-
If your Fabric notebooks use Python, SonarQube can scan them like normal .py files.
-
Export notebooks from Fabric to Git before scanning.
2.Data Pipelines (JSON):
-
Pipelines are saved as JSON in Git.
-
Sonar can read JSON but only checks structure ,it can’t validate pipeline logic.
3.SQL Scripts:
-
Sonar supports T-SQL and other SQL code, so you can scan Fabric SQL scripts for best practices and syntax issues.
4.Other Fabric Items:
-
Dataflows, Lakehouses, and Datasets are metadata-based ,Sonar can’t analyze them yet.
5.CI/CD Integration:
-
You can run Sonar scans automatically in your Azure DevOps or GitHub pipeline after every commit.
Conclusion:
SonarQube works well for Python notebooks and SQL scripts, gives limited checks for JSON pipelines, and doesn’t yet support Lakehouse or Dataflows.Integrating it with your Fabric Git repo is the best way to maintain consistent code quality and CI/CD governance.
- KevinChantSuper User
Just to add to this, some items can't be scanned by Sonar but there are other ways you can test them. The below post highlights some of the other ways for you:
https://www.kevinrchant.com/2024/08/30/unit-tests-on-microsoft-fabric-items/- giulio-dilucaHelper I
Hi KevinChant
thanks for the addition
Regards
-