Adding Oauth and new serviceconnection from Azure DevOps to Bitbucket Cloud fails with error 500

Me Myself And I 5 Reputation points
2026-08-28T13:09:34.2666667+00:00

Hi,
When attempting to create a new Bitbucket Cloud Service Connection in Azure DevOps using the configured OAuth connection, the authorization flow fails with an HTTP 500 Internal Server Error on the Azure DevOps side.


Steps to Reproduce

  1. Navigate to Project Settings > Service connections.
  2. Click New service connection and select Bitbucket Cloud.
  3. Choose the configured OAuth configuration and enter the required details.
  4. Click Authorize / Save.
  5. The Bitbucket OAuth consent screen appears — click Grant access / Approve.

Expected Behavior

The OAuth handshake completes successfully, the Service Connection is saved, and it is ready for use in Azure DevOps pipelines.


Actual Behavior

  • After approving the consent in Bitbucket, Azure DevOps redirects/fails with an HTTP 500 Internal Server Error.
  • The Service Connection cannot be saved.
  • Note: In Bitbucket (under Authorized Applications / OAuth Consumers), the consent is visibly granted, indicating the issue occurs during the callback/token exchange on the Azure DevOps side.
  • Alternative authentication workarounds (e.g., Personal Access Tokens / Basic Auth) are also failing with errors.

Impact & Urgency

  • Priority / Impact: High / Blocker
  • Our teams are currently blocked from setting up and running CI/CD pipelines connecting Azure DevOps to Bitbucket Cloud repositories.

Environment / Context

  • Target: Azure DevOps Service Connection (Bitbucket Cloud)
  • Auth Method: OAuth 2.0 (and fallback authentication methods)
Azure DevOps
0 comments No comments

1 answer

Sort by: Most helpful
  1. Allan Solomon Mejia 10,385 Reputation points
    2026-08-28T16:02:27.59+00:00

    Hello @Me Myself And I

    Based on the behavior you've described, this looks more like an Azure DevOps ↔ Bitbucket Cloud integration/service-side issue than an incorrect OAuth consumer configuration.

    Microsoft's current documentation still lists OAuth ("Grant authorization") and Basic Authentication as supported authentication methods for Bitbucket Cloud service connections. The expected flow is that Azure DevOps redirects to Bitbucket for authorization and then validates/saves the connection.

    The key detail in your case is that Bitbucket successfully records the authorization, but Azure DevOps returns HTTP 500 when processing the callback/token exchange. You also mentioned that alternative authentication methods fail. That makes repeatedly recreating the OAuth consumer unlikely to resolve the underlying problem.

    Other Azure DevOps users have also reported Bitbucket integration failures with both OAuth and API-token-based authentication, including cases where previously working integrations suddenly stopped.

    Here are my suggestions:

    • Check the Azure DevOps Services status page, including the history for your geography. Microsoft notes that Azure DevOps service problems can affect only particular regions or services.
    • Try creating the Bitbucket service connection in another Azure DevOps project/organization, if available. This can help determine whether the problem is organization-specific.
    • Capture the failed authorization request from the browser developer tools (Network) and record the timestamp, HTTP 500 response, Azure DevOps organization, project, and any correlation/activity ID returned.
    • If the failure persists, raise it through the Azure DevOps support/Developer Community channel with those details. Microsoft specifically directs unreported Azure DevOps availability/service problems to its support channels.

    Do not interpret the HTTP 500 as proof that the Bitbucket OAuth credentials are wrong. An invalid client, redirect URI, or authorization grant would normally produce an OAuth-related 4xx response. Here, Bitbucket accepts the authorization and Azure DevOps subsequently fails internally, which warrants investigation on the Azure DevOps side.

    One other point: Azure DevOps' own OAuth framework is being deprecated in 2026, but that documentation concerns applications authenticating to Azure DevOps. It shouldn't automatically be assumed to explain the Bitbucket Cloud service connection failure, since Microsoft's current service-connection documentation still explicitly supports Bitbucket OAuth.

    Sharing these references with you:

    Service connections – Azure Pipelines

    Azure DevOps Services status information

    Related Bitbucket/Azure DevOps authentication reports

    Help make this community better for everyone: if this answer resolved your issue, please accept it or upvote it. If not, share more details in a comment so we can continue the discussion and find the right solution.

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.