3

I deleted what I thought were unused service connections in Azure DevOps, and now I cannot change the connection on existing pipelines. The build pipelines are yaml based but the service connections were set in the UI, so the yaml doesn't contain AzureSubsciption definitions. If I try to run the build pipeline I get this:

Service connection error

If I try to edit the pipeline, I get this:

Longer error

I have another service connection (GitHub App) that I have made available to all pipelines. Is there any way to fix the existing pipelines without having to re-create them? Here is the current yaml file for the builds:

 pool:
  vmImage: 'ubuntu-latest'

variables:
  MAVEN_CACHE_FOLDER: $(Pipeline.Workspace)/.m2/repository
  MAVEN_OPTS: '-Dmaven.repo.local=$(MAVEN_CACHE_FOLDER)'

steps:
- script: 'wget https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip'

- task: ExtractFiles@1
  inputs:
      archiveFilePatterns: 'apache-maven-3.8.6-bin.zip'
      destinationFolder: '$(build.sourcesdirectory)/maven'

- task: Cache@2
  inputs:
    key: 'maven | "$(Agent.OS)" | **/pom.xml'
    restoreKeys: |
      maven | "$(Agent.OS)"
      maven
    path: $(MAVEN_CACHE_FOLDER)
  displayName: Cache Maven local repo

- task: DownloadSecureFile@1
  inputs:
    secureFile: 'settings.xml'
  displayName: Download settings.xml file

- task: Maven@3
  inputs:
    mavenPomFile: 'pom.xml'
    mavenOptions: '-Xmx3072m $(MAVEN_OPTS)'
    publishJUnitResults: false
    javaHomeOption: 'JDKVersion'
    mavenVersionOption: 'Path'
    mavenPath: '$(build.sourcesdirectory)/maven/apache-maven-3.8.6'
    mavenAuthenticateFeed: true
    effectivePomSkip: false
    sonarQubeRunAnalysis: false
    goals: 'test'
  displayName: execute munit tests

- task: Maven@3
  inputs:
    mavenPomFile: 'pom.xml'
    mavenOptions: '-Xmx3072m $(MAVEN_OPTS)'
    publishJUnitResults: false
    javaHomeOption: 'JDKVersion'
    mavenVersionOption: 'Path'
    mavenPath: '$(build.sourcesdirectory)/maven/apache-maven-3.8.6'    
    mavenAuthenticateFeed: false
    effectivePomSkip: false
    sonarQubeRunAnalysis: false
    goals: 'package -DskipTests'
  displayName: package solution


- task: PublishPipelineArtifact@1
  inputs:
    targetPath: $(System.DefaultWorkingDirectory)
    artifact: 'drop'
  displayName: Publish deployment artifacts

1 Answer 1

0
  1. When you define a task in your YAML pipeline, you can specify the service connection to use within the task's configuration. This is done through the inputs section of the task definition.

task: AzureResourceGroupDeployment@2 inputs: azureSubscription: 'Your Azure Service Connection' ...

2.The service connections that are available in your Azure DevOps project settings are the ones that can be used in your pipeline. Ensure that the required service connection is properly defined in your Azure DevOps project before referencing it in your pipeline YAML.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.