Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Symptoms
When you try to verify the automatic Azure RM service connection, you may receive the following error message:
Failed to get Azure DevOps Service access token, cache value is invalid.
Debugging steps
Capture an F12/Fiddler trace while you reproduce the issue.
You will see following response for the POST call in the trace:
{"authorization":{"parameters":{"tenantid":"xxxxxx49-XXXXcexxxxxx","serviceprincipalid":"xxxxxx7e-XXXX-027xxxxxxxxx","authenticationType":"spnKey","serviceprincipalkey":null,"**accesstoken":null**},"scheme":"ServicePrincipal"},"created}
Cause
When you run a service connection update call from the UI, the body of the PUT
request contains an accesstoken = null
entry. If we compare the PUT
payload against the working service connections at either end of the operation, we don't see this entry. If the AccessToken
property is present in the service connection UI object, it should have valid value (such as a GUID). It shouldn't be empty or null.
Resolution
Go to the service connection page, and then select the affected service connection.
Select Edit.
Press F12, and then open the network trace window. If possible, select the Disable cache option in the panel under the Network tab.
Update the description.
Select the Save button.
If you are prompted for authorization, enter the required credentials. In network trace, you can now see the PUT call to update the service connection that failed.
Open the PUT call details, and copy the Request Payload by selecting Payload > view source > Select the content and copy the content.
From the PUT call details, also copy the Authorization header value.
In the request body, remove the accesstoken: null (or accesstoken:'') property under the authorization header.
Copy the updated Request payload, and make a service connection update PUT API call by using Postman (or any other REST tool) by running the following API. Make sure to provide the Authorization header you copied earlier when making this call.
PUT - https://dev.azure.com/{organization}/_apis/serviceendpoint/endpoints/{endpointId}?api-version=6.0-preview.4
For more information, see Endpoints - Update Service Endpoint.