Error message 401: Unauthorized/Invalid Credentials in Visual Studio Bitbucket Cloud Extension

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

Summary

TheVisual 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.

(Auto-migrated image: description temporarily unavailable)

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:

(Auto-migrated image: description temporarily unavailable)

Example:

(Auto-migrated image: description temporarily unavailable)

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.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.