Reputation: 2984
I have a job that needs Windows if there are any NuGet packages because the PushSymbols
task doesn't work on Linux
jobs:
- job: 'The job'
pool:
#${{ if eq(variables.useSelfHostedAgent, 'True') }}: # is ignored
${{ if ne(variables['Build.SourceBranchName'], 'master') }}:
name: 'Default' # run on rwb's machine (plus whatever else is in the default pool).
${{ if ne(variables['Build.SourceBranchName'], 'merge') }}:
demands:
- Agent.OS -equals 'Windows_NT' # PushSymbols task in pack.yml only works on Windows.
${{ else }}:
vmImage: 'windows-latest' # run on the MS hosted pool (limited to 1800 hours per month).
I think that I have such an agent...
.. but Azure doesn't.
##[error]No agent found in pool Default which satisfies the following demand: Agent.OS. All demands: Agent.OS -equals 'Windows_NT', Agent.Version -gtVersion 2.182.1
Pool: Default
Started: Just now
Duration: 1m 12s
What's wrong with it?!
Upvotes: 0
Views: 1426
Reputation: 569
Sometimes I will meet the issue if I add '' in 'Windows_NT'.
However, if I remove the '' in 'Windows_NT' and let it like belows, the issue gone.
demands:
- Agent.OS -equals Windows_NT
Please kindly try whether it works on your side.
Also FYI, the job name in - job: 'The job'
is invalid as it is supposed to not have the symbols like space.
Upvotes: 1