Skip to content

Instantly share code, notes, and snippets.

@thoughtful-solutions
Last active October 24, 2022 10:26
Show Gist options
  • Save thoughtful-solutions/eba36655cb10944e82214121f7f384b8 to your computer and use it in GitHub Desktop.
Save thoughtful-solutions/eba36655cb10944e82214121f7f384b8 to your computer and use it in GitHub Desktop.
Azure DevOPS

Azure DevOPS cli

Configure the CLI

Begin by creating ensuring the tools are in place to work with Azure DevOPS

scoop install azure-cli
az extension --name azure-devops
az extension list

To list the commands in the extension

az devops -h

Create a Public Access Token

Following the instructions here create a PAT for Azure DevOPS

Ensure this token has Full access permissions

And save the token to a file called my_pat_token

Authenticate to Azure DevOPS using PAT Token

cat my_pat_token.txt | az devops login --organization https://dev.azure.com/considrd
az devops configure -l

Create an Azure DevOPS Project

az devops project create --name "dtest" --description "Dependency tests between repositories"

You can check the project with

az devops project list

Configure this project as your default project

az devops configure -d project="dtest"

And confirm configuration using

az devops configure -l

Create git repo within default project

az repos create --name dtest

Commit to repo

Configure git

mkdir repos
cd repos
git config --global user.email "[email protected]"
git config --global user.name "My Real Name"

Now initialise a repo

git init .
touch README.md
git add --all
git commit -m "Initialisation of repo"

az repos show  -r dtest | grep -i remoteUrl\"
   "remoteUrl": "https://[email protected]/considrd/dtest/_git/dtest",
   
git remote add origin https://[email protected]/considrd/dtest/_git/dtest

git push origin master

It will ask for a password which is in the file called my_pat_token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment