0
votes

Issue: Azure devops multi-stage YML build-pipeline does not allow agent pool name as variable if approvals & checks are applied on that agent & it gives below error on pipeline run.

Error--> ##[error]The job is using protected resource(s) for which checks have not been evaluated queue:MY_AGENT_PROD, queue:MY_AGENT_PROD. For more details, refer to https://aka.ms/pipelinechecks.

Example: Private Agent pool name is: "MY_AGENT_PROD", Applied Security > Approvals & Check > Approvals (Added one groups which can approve it)

My Pipeline: Added Pipeline Variable agent.pool.name=MY_AGENT_PROD

stages:
  - stage:
    jobs:
      - job:
        displayName: "READ_PARAM"
        pool:
          name: $(agent.pool.name)
        steps:
          - script: |
              echo appName: $(appName)

Observation: If use pool name directly instead of variable name, it works fine.

Is this a bug in ADO pipeline ?

Please suggest on this, we do not want to hard code agent pool name in pipeline.