I want to call the Azure DevOps REST API's Test Suites - Create endpoint from an Azure DevOps Release pipeline.
I am doing this from a PowerShell task and I am using System.AccessToken
. When I try to create a test suite, I receive the following response:
"message": "You do not have the appropriate permissions to manage test suites under this area path.",
"typeName": "Microsoft.TeamFoundation.TestManagement.WebApi.AccessDeniedException, Microsoft.TeamFoundation.TestManagement.WebApi",
"typeKey": "AccessDeniedException",
Does anybody know what permissions need to be granted in Azure DevOps?
Notes:
When you try to create a test suite, it actually will create the Test Suite to the specified or default area path.
To create test suites on an area path, as the error message has stated, the users/identities must has the "Manage test suites
" permission on the area path.
For you case, if you want to use the System.AccessToken
as the authorization token to call the REST API "Test Suites - Create" in pipelines, you can set the permissions like below:
Go to "Project Settings" > "Project configuration" > "Areas", on the menu item of the area path (or its parent path) which you want to create work items to, select Security to open the Security hub of the area path.
On the Security hub, search for the following two identities and ensure the permission "Manage test suites
" is set to "Allow
" for them. See "Job access tokens".
Project Collection Build Service ({Organization Name})
{Project Name} Build Service ({Organization Name})
After above steps, you can use the System.AccessToken
as the authorization token to call the REST API in pipelines.