microsoft / microsoft/azure-devops-python-api
Cannot get accounts list for a multi-organization access token
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 684
- Fork
- 218
- Merge medio
- 8g 10h
- PR unite (30g)
- 1
Descrizione
Hello,
We have the following sample of code we use to list the accounts of a Token "accessible to all organizations". It was working until October 7th. After digging a little deeper into the library, it's trying to get the /_apis/ResourceAreas to presumably get the URLS to the accounts endpoint and calling it directly results in a 500 Internal error after 100 seconds with this payload
{
"$id": "1",
"innerException": null,
"message": "The remote name could not be resolved: 'dpdbotprodwus30.dpdbot.visualstudio.com'",
"typeName": "System.Net.Http.HttpRequestException, System.Net.Http",
"typeKey": "HttpRequestException",
"errorCode": 0,
"eventId": 0
}
Sample code
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
credentials = BasicAuthentication("", token)
connection = Connection(base_url="https://app.vssps.visualstudio.com", creds=credentials)
location_client = connection.clients_v6_0.get_location_client()
accounts_client = connection.clients_v6_0.get_accounts_client()
connection_data = location_client.get_connection_data()
authenticated_user = connection_data.authenticated_user
# This hangs
accounts = list(accounts_client.get_accounts(member_id=authenticated_user.id))
print(accounts)
Is there an issue on the Azure side ? Or perhaps a better way to get the list of accounts for a multi-org personal access token?
Thank you
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo l’esempio con azure.devops.connection.Connection, chiama get_location_client() e get_accounts_client(), quindi esamina la richiesta ResourceAreas e il percorso del client accounts. Confronta la risposta che fallisce con il comportamento documentato di Azure DevOps per l’elenco degli account. L’attività è completata quando si determina se l’errore è lato servizio oppure si identifica un percorso client/API supportato per token con più organizzazioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100