Add initial implementation of DevOps client and harvester script
This commit is contained in:
		
							
								
								
									
										14
									
								
								harvester.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										14
									
								
								harvester.py
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,14 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
 | 
			
		||||
from devops import Client, DEVOPS_SCOPE
 | 
			
		||||
from azure.identity import DefaultAzureCredential
 | 
			
		||||
from json import dumps
 | 
			
		||||
 | 
			
		||||
def main():
 | 
			
		||||
    token = DefaultAzureCredential().get_token(DEVOPS_SCOPE).token
 | 
			
		||||
    client = Client("https://dev.azure.com/mcovsandbox/", token)
 | 
			
		||||
    projects = client.get_projects()
 | 
			
		||||
    print(dumps(projects, indent=2))
 | 
			
		||||
 | 
			
		||||
if __name__ == "__main__":
 | 
			
		||||
    main()
 | 
			
		||||
		Reference in New Issue
	
	Block a user