Azure DevOps Pipeline environments add approvers - rest api

gryczanu 21 Reputation points
2022-08-31T09:16:01.973+00:00

Hello!

Is there any possibility to add approvers group into pipeline environment by using REST API? I know that we can create environment by REST api: https://learn.microsoft.com/en-us/rest/api/azure/devops/distributedtask/environments/add?view=azure-d... but I couldn't find any information that we can add approvers by REST API. Manual steps looks like in the picture236436-approvals-3.png

I tested solution described here: https://stackoverflow.com/questions/72557511/how-to-add-update-approvers-for-environments-through-rest-api-on-azure-devops
but I couldn't get configuration ID using REST API GET: https://learn.microsoft.com/en-us/rest/api/azure/devops/approvalsandchecks/check-configurations/list?view=azure-devops-rest-7.1&tabs=HTTP
I got error:
Invoke-RestMethod : {"$id":"1","innerException":null,"message":"Value cannot be null.\r\nParameter name:
resourceType","typeName":"System.ArgumentNullException,
mscorlib","typeKey":"ArgumentNullException","errorCode":0,"eventId":0}

when I run GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/checks/configurations?api-version=7.1-preview.1

236522-invoke.png

Thanks

@azure-envionments
@azure-approvals

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,086 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dave Patrick 426.1K Reputation points MVP
    2022-08-31T12:54:46.533+00:00

    Devops / TFS is not currently supported here on Q&A. The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/report?space=21&entry=problem
    https://developercommunity.visualstudio.com/report?space=22&entry=problem
    https://azure.microsoft.com/en-in/support/devops/

    --please don't forget to upvote and Accept as answer if the reply is helpful--

    1 person found this answer helpful.