Error message 401: Unauthorized/Invalid Credentials in Visual Studio Bitbucket Cloud Extension
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
The Visual Studio Bitbucket Extension is a third-party Git plugin used to integrate Visual Studio Code (Visual Studio 2015, 2017, and 2019) with Bitbucket Cloud.
You may receive the "401: Unauthorized" error while integrating using your Bitbucket account username and app password.
Diagnosis
The error message indicates incorrect permissions set for the generated app password.
Solution
The Bitbucket extension plugin uses Bitbucket Cloud REST APIs to perform a set of actions, such as fetching a list of repositories, fetching pull requests, etc. These require app password permissions with the scope of repository, account, workspace, projects, and pull requests. Ensure that you create an app password with minimum write permissions for the aforementioned scope.
App password required permissions:
Example:
We provide Jira and Bitbucket (Atlassian Labs) extensions for the latest versions (2022) of Visual Studio Code.
The Jira Cloud and Bitbucket Cloud integration with Visual Studio Code works seamlessly, but it does require a one-time login to Bitbucket Cloud and Jira Cloud to create site links.
Please refer to the Jira and Bitbucket (Atlassian Labs) Visual Studio marketplace listing for more details.