Skip to content

Commit 48d762a

Browse files
authored
Update README.md
1 parent 344b90e commit 48d762a

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,21 @@ from vsts.vss_connection import VssConnection
1818
from msrest.authentication import BasicAuthentication
1919
import pprint
2020

21-
token='REDACTED'
22-
team_instance='https://REDACTED.visualstudio.com'
21+
# Fill in with your personal access token and org URL
22+
personal_access_token = 'YOURPAT'
23+
organization_url = 'https://dev.azure.com/YOURORG'
2324

24-
credentials = BasicAuthentication('', token)
25-
connection = VssConnection(base_url=team_instance, creds=credentials)
25+
# Create a connection to the org
26+
credentials = BasicAuthentication('', personal_access_token)
27+
connection = VssConnection(base_url=organization_url, creds=credentials)
28+
29+
# Get a client (the "core" client provides access to projects, teams, etc)
2630
core_client = connection.get_client('vsts.core.v4_0.core_client.CoreClient')
2731

28-
team_projects = core_client.get_projects()
32+
# Get the list of projects in the org
33+
projects = core_client.get_projects()
2934

35+
# Show details about each project in the console
3036
for project in team_projects:
3137
pprint.pprint(project.__dict__)
3238
```

0 commit comments

Comments
 (0)