How to create a personal access token (PATs) in Azure DevOps?
Hello Everyone
Welcome to CloudAffaire and this is Debjeet.
Personal Access Token (PATs) can be used for password less authentication for git or REST API in Azure DevOps. Today we will discuss how to create a personal access token (PATs) in Azure DevOps.
What is Personal Access Token (PATs)?
A personal access token (PATs) is used as an alternate password to authenticate into Azure DevOps. If you’re working within Microsoft tools, then your Microsoft account (MSA) or Azure Active Directory (Azure AD) is an acceptable and well-supported approach. But, if you’re working with third-party tools that don’t support Microsoft or Azure AD accounts – or you don’t want to provide your primary credentials to the tool – you can make use of PATs to limit your risk. PATs are easy to create when you need them and easy to revoke when you don’t. To set up PATs for non-Microsoft tools, use Git credential managers or create them manually.
How to create a personal access token (PATs) in Azure DevOps?
Prerequisites:
Step 1: Login to your Azure DevOps account using below link
https://dev.azure.com/your_organization_name
Step 2: Select user setting icon in the top right corner and click “Personal access tokens”.
Step 3: Click on “New Token” to generate a new personal access token.
Step 4: Provide a name, organization, expiration date and scope for your personal access token and click “Create”.
Step 5: Copy and store the personal access token into a safe place and close the window.
Our Personal Access Token (PATs) has been created successfully. You can revoke or regenerate this PATs anytime from this same location. Next, we are going to test if this PATs are working for us by invoking a REST API call using this token.
Note: Always store your PATs in a secure place and never ever share with anyone.
Test your Personal Access Token (PATs)
1 2 3 4 |
## List all the projects under your organization curl -u ## You can get the username by (az account show | jq -r .user.name) |
Hope you have enjoyed this article. To know more about Azure DevOps, please refer below official documentation
https://docs.microsoft.com/en-us/azure/devops/?view=azure-devops