I am trying to get security roles and permissions for agent pools using azure cli, is there a way to get these?
I want to get higlighted users/groups list as well as roles and access levels through Azure cli commands.Can any one help me out on this?
During the test, we haven't found the direct cli command to query the user list of agent pools, but we managed to query the result via the rest api
========================================================
Updated on 11/11
Below is for orgnization-level agent pool permission
get https://dev.azure.com/{orgname}/_apis/securityroles/scopes/distributedtask.agentpoolrole/roleassignments/resources/{agent_pool_ID}?api-version=6.0-preview.1
Below is for project-level agent pool permission
get https://dev.azure.com/{orgName}/_apis/securityroles/scopes/distributedtask.agentqueuerole/roleassignments/resources/{ProjectID}_{QueueID}?api-version=6.0-preview.1
You can get the {QueueID} from the project agent pool url.
========================================================
Updated on 11/15
You could check the query entries from the 200
status result for the related records and test to modify the full rest api (sometime by lucky-draws).