Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get accounts list for a multi-organization access token #473

Open
lindycoder opened this issue Oct 16, 2023 · 0 comments
Open

Cannot get accounts list for a multi-organization access token #473

lindycoder opened this issue Oct 16, 2023 · 0 comments

Comments

@lindycoder
Copy link

lindycoder commented Oct 16, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant