Common errors

This page covers errors of the OAuth 2.0 (Microsoft Entra ID) authentication method for Microsoft Azure DevOps (Team Foundation Server). For other integration errors, see Troubleshooting.

When Test Connection fails with this method, the message has this form: "Unable to connect to Azure DevOps with OAuth 2.0 (Microsoft Entra ID). Check the server, Tenant ID, Client ID and Client Secret, and the app’s access to the organization. Reason:", followed by the reason. For a failure at Microsoft Entra, the reason is one of the messages below that start with "Microsoft Entra". When Azure DevOps rejects the app’s token, the reason starts with "HTTP Error 401. Explanation returned:". When Azure DevOps does not find the organization, it starts with "HTTP Error 404. Explanation returned:": see "HTTP Error 404" and a "404 - Page not found" page. A setting that this method does not accept is reported on its own, without the "Unable to connect" text: see A setting is rejected before any request. A failed sync gives the same reasons.

When Microsoft Entra rejects the credentials with a description, the message "Microsoft Entra rejected the OAuth 2.0 credentials:" continues with the first line of that description, without the part that starts with Microsoft’s "Trace ID:". SD Elements cuts a line longer than 300 characters and ends it with "...".

Codes that start with AADSTS come from Microsoft Entra ID, and codes that start with TF come from Azure DevOps. They are Microsoft’s codes, and Microsoft’s documentation describes them.

"Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS7000215"

The code AADSTS7000215 means that the client secret is wrong.

Resolution

In the Azure DevOps (TFS) Client Secret field, enter the secret’s Value, not its ID. If you do not have the Value, create a new client secret for the app in Microsoft Entra, and enter its Value. Then run Test Connection again.

"Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS7000222"

The code AADSTS7000222 means that the client secret has expired.

Resolution

Create a new client secret for the app in Microsoft Entra, and enter its Value in the Azure DevOps (TFS) Client Secret field of the system connector. Note the new expiry date, and plan to replace the secret before then. Run Test Connection, then save the system connector.

"Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS700016"

The code AADSTS700016 means that Microsoft Entra finds no app with that Client ID in the tenant. Either the Client ID is wrong, or the app is not in the tenant that the Tenant ID names.

For example, with the IDs replaced here by placeholders: "Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS700016: Application with identifier '<client ID>' was not found in the directory '<tenant ID>'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may h..."

With real IDs, the line reaches 300 characters at that point.

Resolution

Compare the Azure DevOps (TFS) Client ID with the Application (client) ID of the app in Microsoft Entra. Then check that the Azure DevOps (TFS) Tenant ID is the Directory (tenant) ID of the tenant where the app is registered.

"Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS90002"

The code AADSTS90002 means that Microsoft Entra does not find the tenant. Usually the Tenant ID is wrong. Microsoft also reports this code for a tenant without an active subscription.

For example, with the ID replaced here by a placeholder: "Microsoft Entra rejected the OAuth 2.0 credentials: AADSTS90002: Tenant '<tenant ID>' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant."

Resolution

Copy the Directory (tenant) ID shown in Microsoft Entra into the Azure DevOps (TFS) Tenant ID field, and run Test Connection again.

If the Tenant ID is right and the message comes back, ask the Microsoft Entra administrator whether the tenant has an active subscription.

"Microsoft Entra rejected the OAuth 2.0 credentials (HTTP 400)"

Microsoft Entra rejected the request and gave no description, so the message ends with the HTTP status of its answer, such as 400, in parentheses instead of an error code.

Resolution

Check the Tenant ID, Client ID and Client Secret against the values in Microsoft Entra, as in the sections above. Enter the secret’s Value, and check that the secret has not expired.

"Microsoft Entra’s answer held no usable access token."

Microsoft Entra accepted the request, but its answer did not contain a usable access token.

Resolution

Run Test Connection again. If the message comes back, contact SD Elements support.

"Microsoft Entra could not be reached at login.microsoftonline.com"

The message ends with the name of the kind of error in parentheses, for example a timeout. SD Elements makes one request for the token and does not retry it. It allows 30 seconds to connect and 30 seconds for each read.

SD Elements also reports this message when it refuses to send the request. With network restrictions on, SD Elements refuses an address that it blocks, and it refuses to send the request through a proxy. Network restrictions are on by default when SD Elements runs the integration, and off by default on a Remote Integration Agent.

Resolution

Allow the computer that runs the integration to reach login.microsoftonline.com over HTTPS (TCP port 443). With an on-premise SD Elements, this is the SD Elements server. For an integration that runs through a Remote Integration Agent, it is the computer that runs the agent. If the computer reaches the internet only through a proxy, this request is refused while network restrictions are on.

"Microsoft Entra is unavailable"

The message continues with the HTTP status in parentheses and the words "Try again later." Microsoft Entra answered with status 429 (too many requests) or with a 5xx server error.

Resolution

Wait, then run Test Connection or the sync again. SD Elements does not retry the token request by itself.

"Microsoft Entra answered with a redirect"

The message continues with the HTTP status in parentheses and the words "which was not followed." Something answered the token request with a redirect. SD Elements does not follow it, because that would send the client secret to another address.

Resolution

Check what sits between the computer that runs the integration and login.microsoftonline.com, such as a proxy or a security gateway, and make sure that it passes the request through unchanged. If the message comes back, contact SD Elements support.

"Azure DevOps rejected the app’s token"

In Test Connection, the reason after "Reason:" is "HTTP Error 401. Explanation returned: Azure DevOps rejected the app’s token. Check that the app is added to the organization with Basic access and to the project’s Contributors group, and that the organization is connected to the app’s Microsoft Entra tenant." Microsoft Entra gave SD Elements a token, and Azure DevOps did not accept it, even after SD Elements asked for a new token and tried again. Microsoft’s codes for this situation are TF400813 and TF401444.

The cause is that the app is not added to the Azure DevOps organization, or that the organization is not connected to the Microsoft Entra tenant that holds the app.

Resolution

  1. Connect the Azure DevOps organization to the Microsoft Entra tenant that holds the app.

  2. Add the app to the organization with Basic access.

  3. Add the app to the project’s Contributors group.

  4. Run Test Connection again.

"TF401289" from Azure DevOps

Azure DevOps refuses the request to create a tag. SD Elements always sets a tag on the work items it creates. When the tag is new, the app needs permission to create it, and an app with Stakeholder access does not have that permission.

Resolution

Change the app’s access in the Azure DevOps organization to Basic. Then sync again.

"HTTP Error 404" and a "404 - Page not found" page

In Test Connection, the message is "Unable to connect to Azure DevOps with OAuth 2.0 (Microsoft Entra ID). Check the server, Tenant ID, Client ID and Client Secret, and the app’s access to the organization. Reason: HTTP Error 404. Explanation returned:", followed by the start of the HTML of the Azure DevOps "404 - Page not found" page. The HTML is cut short and ends with << truncated >>. A connection that uses Password or Personal Access Token gives the same reason, after its own beginning: "Unable to connect to TFS. Please check server URL, ID, password. Reason:".

Azure DevOps answered that it found nothing at the address. The cause is usually that the organization does not exist: a wrong Context Root with dev.azure.com as the Server, or a wrong <organization>.visualstudio.com address as the Server.

Resolution

Open the organization in Azure DevOps and note its name in the address, dev.azure.com/<organization>. With dev.azure.com as the Server, enter that name as the Context Root. With the visualstudio.com address, the Server is <organization>.visualstudio.com and the Context Root is empty. Correct the field, then run Test Connection again.

"TF200016" from Azure DevOps

A sync, or Test Connection on a project connection, fails with "Unable to validate project. Check that <collection> is a valid collection, and <project> is a valid project. Reason: HTTP Error 404. Explanation returned: TF200016: The following project does not exist: <project>. Verify that the name of the project is correct and that the project exists on the specified Azure DevOps Server." Here <collection> is the Collection Name (with that field empty, nothing shows where <collection> stands) and <project> is the name in the Azure DevOps (TFS) Project field. Both authentication methods give this message.

Azure DevOps does not find a project with that name.

Resolution

In the Azure DevOps (TFS) Project field, enter the name of the project as Azure DevOps shows it. Then sync again.

A setting is rejected before any request

Each of these messages names one setting that OAuth 2.0 (Microsoft Entra ID) does not accept. SD Elements checks the settings when you save the connection, and again each time Test Connection or a sync starts, because a configuration file, such as the one a Remote Integration Agent uses, does not pass through the form. A run stops before it sends any request.

In the system connector, saving and Test Connection show each message under the setting it names. An empty Server, Azure DevOps (TFS) Tenant ID, Azure DevOps (TFS) Client ID or Azure DevOps (TFS) Client Secret field shows the form’s own required-field message instead, such as "Field Azure DevOps (TFS) Tenant ID is required." The messages in the table appear only after every setting passes those first checks, so a second save can show more of them. A sync, Test Connection on a project connection, and a run from a configuration file show the message on its own, without the "Unable to connect" text. In those cases, if more than one setting is wrong, the messages appear together in one line, separated by a space.

Message

Resolution

Enter the Directory (tenant) ID shown in Microsoft Entra: a GUID such as 1b2c3d4e-0000-1111-2222-333344445555.

Enter the Directory (tenant) ID from Microsoft Entra in the Azure DevOps (TFS) Tenant ID field.

Enter the Application (client) ID shown in Microsoft Entra: a GUID such as 1b2c3d4e-0000-1111-2222-333344445555.

Enter the Application (client) ID from Microsoft Entra in the Azure DevOps (TFS) Client ID field.

Enter the client secret’s Value from Microsoft Entra.

This message appears when the issue_tracker_client_secret setting in a configuration file is empty. Enter the secret’s Value there.

When you save the system connector or run Test Connection on it, an empty Azure DevOps (TFS) Client Secret field shows "Field Azure DevOps (TFS) Client Secret is required." instead. Enter the secret’s Value in that field.

OAuth 2.0 (Microsoft Entra ID) works only with Azure DevOps Services at dev.azure.com or at your organization’s visualstudio.com address.

Enter dev.azure.com as the Server, the organization’s name as the Context Root, and leave Collection Name empty. Or enter the organization’s <organization>.visualstudio.com address as the Server, and leave Context Root and Collection Name empty. Enter the host only, without https://. A connection to another address, such as an on-premise server, uses Password or Personal Access Token.

OAuth 2.0 (Microsoft Entra ID) needs the https protocol.

Select HTTPS as the Protocol.

OAuth 2.0 (Microsoft Entra ID) needs Enforce Certificate Validation turned on.

Turn on Enforce Certificate Validation, in the connection’s advanced options.

results matching ""

    No results matching ""