SonarQubeAnalyze@7 is failing

    

The task I am using below one:

            - task: SonarQubeAnalyze@7
              displayName: SonarCubeAnalysis
              inputs:
                 jdkversion: 'JAVA_HOME_17_X64'
              continueOnError: true


Error in above task is:

03:06:20.464 ERROR You must define the following mandatory properties for 'Unknown': sonar.projectKey
03:06:20.464 ERROR 
03:06:20.464 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
##[debug]Processed: ##vso[task.logissue type=error;]03:06:20.464 ERROR Error during SonarScanner CLI execution
03:06:20.464 ERROR You must define the following mandatory properties for 'Unknown': sonar.projectKey
03:06:20.464 ERROR 
03:06:20.464 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.
03:06:20.464 ERROR Error during SonarScanner CLI execution
03:06:20.464 ERROR You must define the following mandatory properties for 'Unknown': sonar.projectKey
03:06:20.464 ERROR 
03:06:20.464 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.



I have project key with me, and i have used it correctly

Please let me know what is the fix for this, thanks

Did you define the project key in SonarQubePrepare?

Example:

# Prepare Analysis Configuration task
- task: SonarQubePrepare@7
  inputs:
    SonarQube: '<YourSonarqubeServerEndpoint>'
    scannerMode: 'cli'
    configMode: 'manual'
    cliProjectKey: '<YourProjectKey>'

# Run Code Analysis task
- task: SonarQubeAnalyze@7
  inputs:
    jdkversion: 'JAVA_HOME_17_X64'

Or are you expecting the project key to be picked up from somewhere else?