GitOps using ArgoCD with Azure git repository

To learn more on ArgoCD you can visit documentation by clicking the link https://argo-cd.readthedocs.io/en/stable/

Let us start by generating the PAT for Azure Git Repository, please follow the below steps:-

A personal access token (PAT) is used as an alternate password to authenticate into Azure DevOps. Learn how to create, use, modify, and revoke PATs for Azure DevOps.

  1. Sign in to your organization in Azure DevOps (https://dev.azure.com/{yourorganization})
  2. From your home page, open your user settings, and then select Personal access tokens.
  3. And then select + New Token.
  4. Name your token, select the organization where you want to use the token, and then choose a lifespan for your token.
  5. Select the scopes for this token to authorize for your specific tasks.
  6. When you’re done, make sure to copy the token. For your security, it won’t be shown again. Use this token as your password.

In case of Token get expire you need the below screen to regenerate Token

Now lets go to ArgoCD and create new repository:-

The important thing to remember is the username must be “git”, now enter required details like valid Azure Git URL and PAT would go in below marked input box:-

You can use the console also to update the PAT.

argocd repo add https://dev.azure.com/companyname/REPO-HEADER/_git/reponame --username git --password myPAT --insecure-skip-server-verification --upsert

Have Fun…