Open clemlesne opened 9 months ago
Thank you for opening this issue, we will look into it.
I succeeded in executing the call with az devops invoke
.
Nevertheless:
az pipelines permissions enable --name=xxx --queue=xxx
(plus az pipelines permissions disable [args]
and az pipelines permissions show [args]
)Script:
#!/bin/bash
set -e
pipeline_id="xxx"
project_id="xxx"
queue_id="xxx"
# Store body in a temp file
tmp_file=$(mktemp -t XXXXXX.json)
# Add body content
cat <<EOF > ${tmp_file}
{
"pipelines": [{
"authorized": true,
"id": "${pipeline_id}"
}]
}
EOF
# Execute command
az devops invoke \
--api-version 7.1-preview \
--area pipelinePermissions \
--http-method PATCH \
--in-file ${tmp_file} \
--resource pipelinePermissions \
--route-parameters project=${project_id} resourceType=queue resourceId=${queue_id} \
> /dev/null
# Cleanup
rm -f ${tmp_file}
Preconditions
Related command
Resource Provider
N/A
Description of Feature or Work Requested
I'm automating integration testing with Azure DevOps Pipelines for on-premise agent containers. This requires me to create projects & pipelines, execute them, and confirm the result.
Each time a new pipeline is created, and a first run is programmed, the pipeline never runs and a message "This pipeline needs permission to access a resource before this run can continue" is displayed. This requires a manual intervention on two buttons.
This behaviour disrupts a lot of the workflow. I would need a way to authorize a pipeline to run on a specific agent pool.
Minimum API Version Required
N/A
Swagger PR link / SDK link
N/A
Request Example
No response
Target Date
2023-03-01
PM Contact
N/A
Engineer Contact
N/A
Additional context
In the Azure DevOps web interface, this call is executed: https://learn.microsoft.com/en-us/rest/api/azure/devops/approvalsandchecks/pipeline-permissions/update-pipeline-permisions-for-resource?view=azure-devops-rest-7.1&tabs=HTTP.
HTTP call:
Request body:
Related: