Search code examples
azure-devops-rest-apiazure-devops-extensions

What scope is required to call Executionhistory - List


I am creating a dashboard extension, and would like to call Executionhistory - List.

Currently, the extension manifest specifies only the scope vso.serviceendpoint_manage.

I get my authorization token via

const token = await VSS.getAccessToken();
var authHeader = VSS_Auth_Service.authTokenManager.getAuthorizationHeader(token);

I am able to successfully get a list of all service endpoints by using Endpoints - Get Service Endpoints

However, when I try to get the Execution History for a given Service Endpoint, I get a CORS policy error.

Access to {devops rest api} from origin {marketplace url} has been blocked by CORS policy

I know CORS errors can occur if the PAT does not have the correct scopes see here.

Note: When I try this locally with a PAT with all scopes, this call works. So I am fairly certain I am missing an extension scope.

Which scope am I missing?


Solution

  • To get service endpoint execution history, no need to set anything other, just set PAT token scope as Read & manage to Tokens:

    enter image description here

    You will see it is work to run this Executionhistory - List api.