Reputation: 833
I am using invoke rest api task in pipeline
I have saved Azure DevOps Pat token in variable with name system.AccessToken
Its giving error unauthorized
I also tried converting PAT token to base64 and then saving in variable. Its still showing same error.
What value do I need to provide for system.AccessToken ?
Upvotes: 0
Views: 1356
Reputation: 3058
You do not need to add PAT token to your variables. System.AccessToken is a special variable that carries the security token used by the running build.
In addition, you are using Invoke Rest API task in an agentless job, so you also don't need to set "allow scripts to access the OAuth token" option.
Here is my sample and it works well:
1.Create service connection:
2.Configuration of Invoke REST API task:
Upvotes: 1