ValueError: API resource location is not registered
I want to extract users list from azure devOps using but an error appears:
ValueError: API resource location 229a6a53-b428-4ffb-a835-e8f36b5b4b1e is not registered on https://vssps.dev.azure.com/(my Organization).
I have already tried to extract the projects list and extracting descriptors for the specific user so connection is ok.
here is my code:
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
personal_access_token = 'my personal access token'
organization_url = 'https://dev.azure.com/(my Organization)'
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
accounts_client = connection.clients_v5_1.get_accounts_client()
get_acc = accounts_client.get_accounts()
for acc in get_acc:
print(acc)
I need to get information about the last access and date created account so maybe another way?
Fixed in #292
Test code:
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
location_client = connection.clients_v5_1.get_location_client()
connection_data = location_client.get_connection_data()
accounts_client = connection.clients_v5_1.get_accounts_client()
get_acc = accounts_client.get_accounts(member_id=connection_data.authenticated_user.id)
for acc in get_acc:
print(acc)
@rilooth thanks for reporting this issue. On a side note, you mention trying to get a list of users. The accounts clients deals with organizations rather than individual users. You may want to look into the Graph APIs.
This release has the fix: https://github.com/microsoft/azure-devops-python-api/releases/tag/5.1.0b6
Hi @tedchamb, I've tested your code snippet, doesn't seem work in my case. still getting error ValueError: API resource location 229a6a53-b428-4ffb-a835-e8f36b5b4b1e is not registered on