title: How can authenticate to Azure DevOps using it's python client API?
body: <p>I am trying to automate creating the user in azure devops by writing a python script for that. I used the python client API of azure-devops for this purpose.</p>
  
  <p>As of now, the authentication is done using a personal access token(PAT) :</p>
  
  <pre><code>from azure.devops.connection import Connection
  from msrest.authentication import BasicAuthentication
  
  personal_access_token = &lt;myPAT&gt;
  organization_url = 'https://dev.azure.com/&lt;myOrganization&gt;'
  
  # Create a connection to the org
  credentials = BasicAuthentication('', personal_access_token)
  connection = Connection(base_url=organization_url, creds=credentials)
  </code></pre>
  
  <p>Actually, I have a script that uses Graph API which authenticates to Azure AD via ADAL. That means I already have an application registered in our Azure AD which was created to use Graph API. </p>
  
  <p>Can I use this application and it's client ID to authenticate to Azure DevOps services? How can use this authentication method with Python client API?</p>
  
  <p>Does this article about OAuth 2.0 authentication method point to the same? : 
  <a href="https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?toc=%2Fazure%2Fdevops%2Forganizations%2Ftoc.json&amp;bc=%2Fazure%2Fdevops%2Forganizations%2Fbreadcrumb%2Ftoc.json&amp;view=azure-devops#register-your-app" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?toc=%2Fazure%2Fdevops%2Forganizations%2Ftoc.json&amp;bc=%2Fazure%2Fdevops%2Forganizations%2Fbreadcrumb%2Ftoc.json&amp;view=azure-devops#register-your-app</a></p>
  
  <p>I got confused as it says to create an app in azure devops, not in azure AD.</p>
  
  <p>Could anyone help me by clarifying this and explaining the steps to do this authentication, if possible?</p>