SonarPrepareTask failing with error

Please find below information

Sonar prepar task giving following error :

##[error][ERROR] SonarQube Server: Error while executing task Prepare: Input required: cliProjectKey

##[debug]Processed: ##vso[task.issue type=error;source=TaskInternal;][ERROR] SonarQube Server: Error while executing task Prepare: Input required: cliProjectKey

##[debug]task result: Failed

##[error]Input required: cliProjectKey

But i have already provided below values to the sonar prep task :slight_smile:

  • name: scanner_config_mode

    type: string

    default: ‘manual’

  • name: sonar_connected_service_name

    type: string

    default: ‘SonarQube’

  • name: extra_properties

    type: string

    default: ‘’

  • name: scanner_mode

    type: string

    default: ‘cli’

  • name: project_key

    type: string

    default: ‘’

  • name: sonar_scan_enabled

    type: boolean

    default: true

Hi,

I’m not seeing a project key value here, just the listing that the default is an empty string.

Is this your actual configuration or just a list of the fields you’re filling out?

 
Thx,
Ann

What is the project key we supposed to give as a test, our code is not associated with dotnet, maven etc but it is having only SQL files.

Hi,

The project key is a value you assign. It’s the identifier SonarQube uses for your project. It can’t be blank.

If you already created/onboarded your project through the UI, then you would have already assigned it an ID there, so re-use that value during analysis.

 
HTH,
Ann