Using any organization backed by your Microsoft Entra ID, complete the following steps. If you don't have access to an organization, create one by signing in to Start.VisualStudio.com with your Microsoft Entra identity. You can delete the organization when you're done.
Sign in to your organization (https://dev.azure.com/{yourorganization}).
Select Organization settings.
Select Microsoft Entra ID, and then Download.
You can get a list of organizations backed by Microsoft Entra ID by using the az account list command. To get started, see Azure DevOps CLI.
To get a list of Microsoft Entra ID tenants, use the following command:
az account list --output table
This command lists all the tenants you have access to.
Currently, there's no direct Azure CLI command to list Azure DevOps organizations connected to a specific Microsoft Entra ID tenant. But, you can use the Azure DevOps REST API in combination with the Azure CLI to do so.
Set the Azure DevOps organization and project:
az devops configure --defaults organization=https://dev.azure.com/{My_Organization}/
Use the REST API to list organizations. Ensure you have a personal access token (PAT). You can generate a PAT from Azure DevOps. Use the following command to list projects with an organization:
az rest --method get --uri https://dev.azure.com/{My_Organization}/_apis/projects?api-version=6.0 --headers "Authorization=Bearer {PAT}"
This process should correctly authenticate and retrieve the list or organizations connected to your Microsoft Entra ID.