You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the login flow, I would additional need the option to select the Entra Tenant I want to connect to.
Why
I am working with many different Azure DevOps Organisations in different Entra Tenants while keeping one identity as guest users in all of the tenants.
Because /common is hardcoded, Entra ID issues tokens scoped to the user's home tenant rather than the Azure DevOps organization's resource tenant. Azure DevOps then denies access to the organization's projects and repositories, returning empty arrays ([]) from the REST APIs.
Solution
Azure DevOps exposes the organization's resource tenant ID directly on the organization endpoint without requiring manual tenant input from the user.
A HEAD request to https://dev.azure.com/{organization} returns:
By resolving the authority dynamically from the target organization:
asyncfunctiongetAzureAuthority(organization){if(!organization)returnAZURE_AUTHORITY;try{constres=awaitfetch(`https://dev.azure.com/${encodeURIComponent(organization)}`,{method: "HEAD",headers: {"User-Agent": "Copilot-CLI-Azure-DevOps-Canvas"},});consttenant=res.headers.get("x-vss-resourcetenant");if(tenant){return`https://login.microsoftonline.com/${tenant}/oauth2/v2.0`;}}catch{// Fall back to /common}returnAZURE_AUTHORITY;}
Using this authority when constructing authorizeUrl, calling requestMicrosoftToken, and storing it for token refreshes allows guest users to authenticate directly against the organization's tenant without needing manual tenant entry.
I applied the proposed approach locally: discovering the organization’s tenant via X-VSS-ResourceTenant and using that authority for authorization, token exchange, and refresh. After signing in again, the canvas correctly loads my repository, pull requests, and work items.
Please include this into the app.
Activity
bagleytravis68 commentedon Sep 15, 2026
Root cause and automatic resolution
We encountered this exact issue when connecting to an Azure DevOps organization as a guest user (an external identity from another Entra ID tenant).
Cause
In
azure-devops-copilot-plugin/extensions/azure-devops/canvas-server.mjs:Because
/commonis hardcoded, Entra ID issues tokens scoped to the user's home tenant rather than the Azure DevOps organization's resource tenant. Azure DevOps then denies access to the organization's projects and repositories, returning empty arrays ([]) from the REST APIs.Solution
Azure DevOps exposes the organization's resource tenant ID directly on the organization endpoint without requiring manual tenant input from the user.
A
HEADrequest tohttps://dev.azure.com/{organization}returns:X-VSS-ResourceTenant: <tenant-guid>WWW-Authenticate: Bearer authorization_uri=https://login.microsoftonline.com/<tenant-guid>By resolving the authority dynamically from the target organization:
Using this authority when constructing
authorizeUrl, callingrequestMicrosoftToken, and storing it for token refreshes allows guest users to authenticate directly against the organization's tenant without needing manual tenant entry.MetzMarkus commentedon Oct 6, 2026
I applied the proposed approach locally: discovering the organization’s tenant via
X-VSS-ResourceTenantand using that authority for authorization, token exchange, and refresh. After signing in again, the canvas correctly loads my repository, pull requests, and work items.Please include this into the app.
meozhang commentedon Nov 5, 2026
Thanks for the feedback. We've logged this with the Azure DevOps canvas team.