Azure DevOps Pipeline failing on SonarCloudPrepare Task - Authentication with the server has failed

We are getting an error on a Prepare Task of a pipeline after updating it to the version 3.

13:26:00.895 WARNING: Authentication with the server has failed.

Full Log below:

Starting: SonarCloudPrepare

==============================================================================

Task : Prepare Analysis Configuration

Description : Prepare SonarQube Cloud analysis configuration

Version : 3.4.3

Author : sonarsource

Help : [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)

==============================================================================

[INFO] SonarQube Cloud: Server version: 8.0.0.85609

[INFO] SonarQube Cloud: Default branch of this repository is ‘refs/heads/main’

D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\3.4.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:smart-int-development_SmartDataLink /o:smart-int-development

SonarScanner for MSBuild 10.3

Using the .NET Framework version of the Scanner for MSBuild

Pre-processing started.

Preparing working directories…

13:26:00.556 Updating build integration targets…

13:26:00.895 WARNING: Authentication with the server has failed.

13:26:00.895 WARNING: In version 7 of the scanner, the default value for the sonar.host.url changed from “http://localhost:9000” to “https://sonarcloud.io”.

If the intention was to connect to the local SonarQube instance, please add the parameter: /d:sonar.host.url=“http://localhost:9000

##[error]13:26:00.897 Pre-processing failed. Exit code: 1

13:26:00.897 Pre-processing failed. Exit code: 1

##[error][ERROR] SonarQube Cloud: Error while executing task Prepare: The process ‘D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\3.4.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

##[error]The process ‘D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\3.4.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

Finishing: SonarCloudPrepare

  • ALM used (GitHub, Bitbucket Cloud, Azure DevOps)
  • CI system used (Bitbucket Cloud, Azure DevOps, Travis CI, Circle CI
  • Scanner command used when applicable (private details masked)
  • Languages of the repository
  • Only if the SonarCloud project is public, the URL
    • And if you need help with pull request decoration, then the URL to the PR too
  • Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
  • Steps to reproduce
  • Potential workaround

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Have you tried the current version SonarCloudPrepare@4?

We just tried the version 4 but getting the error below.

This is just happening with this project. Not sure if there are any other check we can do to ensure the configuration is correct.

This is preventing us to build our code for one application at the moment.

Starting: SonarCloudPrepare

==============================================================================

Task : Prepare Analysis Configuration

Description : Prepare SonarQube Cloud analysis configuration

Version : 4.2.3

Author : sonarsource

Help : [More Information](https://docs.sonarcloud.io/advanced-setup/ci-based-analysis/sonarcloud-extension-for-azure-devops/)

==============================================================================

[INFO] SonarQube Cloud: Server version: 8.0.0.85682

[INFO] SonarQube Cloud: Default branch of this repository is ‘refs/heads/main’

D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\4.2.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe begin /k:smart-int-development_SmartDataLink /o:smart-int-development

SonarScanner for .NET 11.2.1

Using the .NET Framework version of the Scanner for .NET

Pre-processing started.

Preparing working directories…

08:07:28.224 Updating build integration targets…

08:07:28.440 WARNING: Authentication with the server has failed.

08:07:28.440 WARNING: In version 7 of the scanner, the default value for the sonar.host.url changed from “http://localhost:9000” to “https://sonarcloud.io”.

If the intention was to connect to the local SonarQube instance, please add the parameter: /d:sonar.host.url=“http://localhost:9000

##[error]08:07:28.441 Pre-processing failed. Exit code: 1

08:07:28.441 Pre-processing failed. Exit code: 1

##[error][ERROR] SonarQube Cloud: Error while executing task Prepare: The process ‘D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\4.2.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

##[error]The process ‘D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\4.2.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe’ failed with exit code 1

Finishing: SonarCloudPrepare

Are you using SonarQube Server or Cloud? They have different tasks for Azure Pipelines, SonarCloudPrepare@4 for Cloud and SonarQubePrepare@8 for Server (and the corresponsinf Analyse and Publish tasks).

SonarQube Cloud as you can see from the logs:

[INFO] SonarQube Cloud: Server version: 8.0.0.85682

[INFO] SonarQube Cloud: Default branch of this repository is ‘refs/heads/main’

Adding here these 2 lines from the log:

2026-04-21T05:47:59.3295604Z Downloading task: SonarCloudPrepare (4.2.3)
2026-04-21T05:47:59.7908221Z ##[debug]Task 'SonarCloudPrepare' has been downloaded into 'D:\a\_tasks\SonarCloudPrepare_14d9cde6-c1da-4d55-aa01-2965cd301255\4.2.3'.
2026-04-21T05:48:00.1551661Z ##[debug]Agent environment resources - Unable to get disk info, exception: Value cannot be null. (Parameter 'driveName'), Memory: Used 2369.00 MB out of 8190.00 MB, CPU: Usage 37.00%

Is anyone from SonarCloud available to have a look into this? Happy to share a detailed log if needed.