azure-devops-dotnet-samples icon indicating copy to clipboard operation
azure-devops-dotnet-samples copied to clipboard

Pipelines/Checks/Configurations Example

Open wjdavis5 opened this issue 4 years ago • 1 comments

Hello! I'm working on setting up ServiceConnections with this api. You can now setup approvals/checks on Service Connections. I can see the website using _apis/pipelines/checks/configurations/$id but I'm struggling to figure out how to do that with this API.

Are there any examples that I'm missing?

wjdavis5 avatar May 18 '20 14:05 wjdavis5

Hi @wjdavis5

I was able to get the API request working by issuing a POST against: https://dev.azure.com/{organization}/{project_name}/_apis/pipelines/checks/configurations?api-version=5.2-preview.1

Using Basic authentication, with a Personal Access Token (PAT) as the password.

And the following in the body: { "type": { "id": "8C6F20A7-A545-4486-9777-F762FAFE0D4D", "name": "Approval" }, "settings": { "approvers": [ { "displayName": "[Your Name]", "id": "[Your User Id]", "uniqueName": "[Your Email Address]" } ], "executionOrder": 1, "instructions": "", "blockedApprovers": [], "minRequiredApprovers": 0, "requesterCannotBeApprover": false }, "resource": { "type": "environment", "id": "1", "name": "Test" }, "timeout": 43200 }

max-morrow-dp avatar Oct 30 '20 20:10 max-morrow-dp