Forum Discussion
Fabric - Sonar Scan
- 1 year ago
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.
-
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.
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-diluca1 year ago
Helper I
Hi KevinChant
thanks for the addition
Regards