A '401 Unauthorized' error is thrown when adding Azure Devops integration to vFunction Server



Overview of the Issue

This issue occurs in the following circumstances:

  1. A vFunction organization uses a cloud-based Azure Devops instance for Issue Tracking
  2. A user in the organization creates a Personal Access Token (PAT) and defines the Scopes of permissions for the Personal Access Token rather than giving the Token, “Full Access” permissions
  3. A vFunction Administrator logs into the vFunction Server UI
  4. The Administrator selects Settings (the Person icon) in the top-right corner of the UI
  5. The Administrator selects Settings from the dropdown choices
  6. The Administrator selects Configure Integrations from the left-hand sidebar
  7. The Administrator selects Azure Devops from the Workspace type dropdown menu under Task Management System in the dialog box that launched
  8. The Administartor adds the Token string created in the Azure Devops’s Create PAT flow and the Org as the Azure Devops Organization Name, e.g. “vfunctionpeter” in the Azure Devops URL https://dev.azure.com/vfunctionpeter
  9. Unexpectedly, when clicking the Integrate Azure button, an error is generated in the UI that An error has occurred. Please check the input and try again
  10. Unexpectedly, the F12 Network Console shows that the API call api/v1/organizations/issuetracking/config** returned a 401 Unauthorized Error

Solution

The following steps can be used to resolve this issue:

  1. Log into the Azure Devops Personal Access Token page, e.g. https://dev.azure.com/$YOUR_ORGANIZATION_NAME/_userSettings/tokens
  2. Check the box next to the Token that was created for the vFunction integration
  3. Click the Edit button on the top-right above the list of Tokens
  4. Click the Show more scopes link at the bottom of the Edit a personal access token dialog box
  5. Check the box for Read under the scope Graph: Read, group, scope, and add
  6. Click Save on the bottom of the dialog box
  7. Return to the vFunction Server UI’s Configure Integrations dialog box
  8. Click Integrate Azure again using the same Token and Org information