1
votes

We have azure build pipelines, some are in visual editor and few are in yaml. I am trying to add sonarcloud analysis to these pipelines. This work fine in the visual editor, I am copying same yaml from visual editor to add in existed yaml pipeline. I am getting this error.

An error occurred while loading the YAML build pipeline. The service connection name 00000000-0000-0000-0000-000000000000 is ambiguous.

What I have done so far, checked below resources and tried solutions mentioned there,

  1. https://github.com/Microsoft/azure-pipelines-yaml/issues/31
  2. VSTS anybody managed to use "secure file" in azure-pipelines.yml?
  3. https://github.com/Microsoft/azure-pipelines-agent/issues/1809
  4. create a new azure yaml pipeline
  5. Verify sonarcloud connection in service connections in project settings.

this is my task definition

- task: SonarSource.sonarcloud.****************.SonarCloudPrepare@1
  displayName: 'Prepare analysis on SonarCloud'
  inputs:
    SonarCloud: *************
    organization: ****
    projectKey: "******"
    projectName: "************"
1
i've had this error, i think it means you have 2 service connections with the same name and you reference it not by guid, but by name, so it cannot figure out which one of these are you calling, also, I've edited your task definition, you had to many spaces, try like this?4c74356b41

1 Answers

0
votes

Check your service connections.

To get the appropriate screen... Log into DevOps, go to the project overview, mouse over the project name, click the settings (gear) icon and then select the "Service Connections" navigation link in the left side navigation panel.

There's an odd behavior in the "Authorize" functionality; it will create a new service connection for the subscription you select (and name it after the subscription) even if it already exists. This results in multiple service connections with the exact same name.

Disconnect them all (select the "Disconnect" option in the "Actions" panel) and then add a new connection for the same subscription with a name that makes sense and then use that name (select that connection) for all task input values (e.g. ConnectedServiceNameARM or azureSubscription) where that information is needed.