Hello SonarCloud Community,
I am encountering an issue with SonarCloud analysis in my Azure DevOps pipeline. Despite successful pipeline execution, the analysis results on SonarCloud appear empty. I would greatly appreciate any guidance or suggestions to resolve this.
Pipeline Overview:
- I have set up a pipeline in Azure DevOps for a project that involves IoT Edge development.
- The pipeline includes steps for SonarCloud code analysis, IoT Edge module build and push, and artifact publishing.
Key Configuration Details:
- SonarCloud service connection is set up in Azure DevOps.
cliProjectKey
andcliProjectName
are configured to match the project in SonarCloud.sonar.inclusions
is set to**/*.cs
, targeting C# files.- Source path for analysis is set under
cliSources
asModules
.
Issue Description:
- The pipeline completes without errors, but the SonarCloud analysis shows no data.
- I have verified the paths and patterns for source code inclusions.
I’ve checked the pipeline logs and no clear errors or warnings related to SonarCloud.
I am wondering if there might be a specific configuration or step that I’m missing or if there’s a known issue with such a setup. Any insights, suggestions, or guidance would be immensely helpful.
Thank you in advance for your time and assistance.
pool:
name: Azure Pipelines
demands: java
steps:
- task: SonarSource.sonarcloud.####.SonarCloudPrepare@1
displayName: 'Prepare analysis on SonarCloud'
inputs:
SonarCloud: 'sonarcloud'
organization: '#####'
scannerMode: CLI
configMode: manual
cliProjectKey: 'Factory_Edge'
cliProjectName: 'Factory_Edge'
cliSources: Modules
extraProperties: |
sonar.inclusions=**/*.cs
continueOnError: true
- bash: 'sudo pip install -U iotedgedev pyOpenSSL==21.0.0 cryptography==38.0.4'
displayName: 'Bash Script'
- task: AzureIoTEdge@2
displayName: 'Azure IoT Edge - Build module images'
inputs:
templateFilePath: Modules/deployment.template.json
- task: AzureIoTEdge@2
displayName: 'Azure IoT Edge - Push module images'
inputs:
action: 'Push module images'
azureSubscriptionEndpoint: '#######'
azureContainerRegistry: '{"loginServer":"iot####.azurecr.io"}'
templateFilePath: Modules/deployment.template.json
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: modules'
inputs:
ArtifactName: modules
- task: SonarSource.sonarcloud.######.SonarCloudAnalyze@1
displayName: 'Run Code Analysis'
continueOnError: true