Reputation: 810
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:
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.
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://learn.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)'
Upvotes: 12
Views: 32028
Reputation: 729
The question does not really state if you are dealing with Azure DevOps Services or with Azure DevOps Server. With Server this did the trick for me:
pool:
name: 'myPoolName'
Upvotes: 4
Reputation: 2054
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)
Upvotes: 11
Reputation: 72191
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.
Upvotes: 4