GitHub & Azure DevOps, C#
I keep getting the following error on the analysis step
##[error]ERROR: Error during SonarScanner execution
##[error]ERROR: You must define the following mandatory properties for ‘Unknown’: sonar.projectKey
Here’s a portion of the yaml scripts
- task: SonarCloudPrepare@1
displayName: 'Enabling Sonar Cloud ${{variables.project}} ${{variables.Version}}'
inputs:
SonarCloud: <TheConnectedService>
organization: <TheSonarOrganisation>
scannerMode: CLI
# projectKey: <Organisation>_<SonarProject>
# extraProperties: sonar.sources=${{variables.project}} Mono repo fiolder?
cliProjectKey: <Organisation>_<SonarProject>
cliSources: ${{variables.project}} Mono repo fiolder?
cliProjectVersion: ${{variables.Version}}
cliProjectName: ${{variables.project}}
steps:
- task: SonarCloudAnalyze@1
displayName: 'Analysis Sonar Cloud ${{variables.project}} ${{variables.Version}}'
steps:
- task: SonarCloudPublish@1
displayName: 'Publish Sonar Cloud ${{variables.project}} ${{variables.Version}}'