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.
As of now, the authentication is done using a personal access token(PAT) :
from azure.devops.connection import Connection
from msrest.authentication import BasicAuthentication
personal_access_token = <myPAT>
organization_url = 'https://dev.azure.com/<myOrganization>'
# Create a connection to the org
credentials = BasicAuthentication('', personal_access_token)
connection = Connection(base_url=organization_url, creds=credentials)
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.
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?
Does this article about OAuth 2.0 authentication method point to the same? : https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/oauth?toc=%2Fazure%2Fdevops%2Forganizations%2Ftoc.json&bc=%2Fazure%2Fdevops%2Forganizations%2Fbreadcrumb%2Ftoc.json&view=azure-devops#register-your-app
I got confused as it says to create an app in azure devops, not in azure AD.
Could anyone help me by clarifying this and explaining the steps to do this authentication, if possible?