Reputation: 219
So, a bit of a strange one and I'm hoping that someone's had this issue and found a fix (Or understands why it's happening)
So this used to work without any issue... Just started happening this week - to our knowledge
Basically, when you create a new Azure Resource Manager Service Connection within Azure DevOps you get the following error;
Failed to obtain the Json Web Token(JWT) using service principal client ID. Exception Message: Object reference not set to an instance of an object.
This only happens on our On-Prem Azure DevOps server - I can create the service connection with the same settings on our Dev.Azure.com version without any issues.
Troubleshooting
Obviously, I've tried googling this issue, it comes up in a couple of places but none of which have a resolution or an understanding of why it's happening...
TIA
Upvotes: 3
Views: 7653
Reputation: 8949
The solution can be found on the Troubleshooting page accessible from the "Troubleshoot" link in the Edit pane of the Service Connection: Troubleshoot ARM service connections
Relevant section pasted here for reference/persistence:
Failed to obtain the JWT by using the service principal client ID
This issue occurs when you try to verify a service connection that has an expired secret.
To resolve this issue:
Go to Project settings > Service connections, and then select the service connection you want to modify.
Select Edit in the upper-right corner, and then make any change to your service connection. The easiest and recommended change is to add a description.
Select Save to save the service connection.
⚠ Note
Select Save. Don't try to verify the service connection at this step.
Exit the service connection edit window, and then refresh the service connections page.
Select Edit in the upper-right corner, and now select Verify.
Select Save to save your service connection.
Upvotes: 6
Reputation: 76720
Azure DevOps OnPrem - Service Connection failed - Failed to obtain the Json Web Token
According to the official document Troubleshoot Azure Resource Manager service connections.
These errors typically occur when your session has expired. You can refer to this document and follow the steps:
- Sign out of Azure Pipelines or TFS.
- Open an InPrivate or incognito browser window and navigate to https://visualstudio.microsoft.com/team-services/.
- If you are prompted to sign out, do so.
- Sign in using the appropriate credentials.
- Choose the organization you want to use from the list.
- Select the project you want to add the service connection to.
- Create the service connection you need by opening the Settings page. Then, select
Services
>New service connection
>Azure Resource Manager
.
And you could try to run below script on the Azure DevOps OnPrem machine and can verify if able to generate the access token.
Upvotes: 0
Reputation: 4301
The following link is for a different variation of your problem, but the first comment suggests a Powershell script that could be run that might provide more details?
Upvotes: 0