3
votes

I followed the documentation for setting pool via Pipelines Schema Docs and set it as such pool: Default. This should direct pipelines to use the Default pool:

Default agent pool under All agent pools in dev-ops UI

However, I keep getting this error:

Could not find a pool with name Default. The pool does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz.

Could not find a pool with name Default. The pool does not exist or has not been authorized for use. For authorization details, refer to https://aka.ms/yamlauthz.

As far as I can tell it should be authorized.

I also tried:

pool:
  name: Default

Full azure-pipelines.yml

# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core

name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)

trigger:
  batch: true
  branches:
    include:
    - master
    - develop

pool: Default

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@0

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: VSTest@2
  inputs:
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'
2
try changing your branch to any other branch and saving your pipeline and changing it back and saving it. run pipeline after that4c74356b41
@4c74356b41 I updated my post to contain my full yml file. I am currently triggering builds off of two different branches. It sounds like your recommendation is based on the classic pipeline editor not a yml based pipeline? Editing my pipeline only allows me to update my azure-pipelines.yml from the browser. If I try to manually queue a build off of any of the branches in my repo I get the same error.Jason G.
click on the cogwheel on the top right and click variables, you'll get to the old ui and there you can do what I'm saying.4c74356b41
@4c74356b41 Selecting Default from the Agent Pool dropdown in the old UI and saving fixed it. It didn't seem to make any changes to my yml file though.Jason G.

2 Answers

3
votes

You can refer to this link: https://aka.ms/yamlauthz to fix this issue ;)

Try changing your branch to any other branch and saving your pipeline and changing it back and saving it. Run pipeline after that.

To accomplish this click on Edit on the top right of the Pipelines/Build page. You will be presented with the YAML editing tool. Now click the hamburger icon on the top right and select Variables. This will take you to the classic editor. From the classic editor click on the YAML tab. Under the YAML tab you can select Get sources and change you default branch.

3
votes

I had the same issue for 'Azure Pipelines'. It turned out that the project did not had Azure Pipelines pool added in the Agent pools. You can configure this in Azure DevOps at the Project Settings. (gear icon bottom left)

enter image description here