DEV Community

AIDA
AIDA

Posted on

3 2

Create a repo in Azure DevOps using the CLI and PowerShell

This is a part of a series on using VM images in Azure compute to build lightweight application deployment options as opposed to PaaS options such as App Services and more complex IaaS such as Azure Kubernetes Service.


Prerequisites

First, ensure you are logged into Azure CLI (az login) to the correct account, if you have the DevOps extension, this will authenticate there as well.

To keep this work separate from any of our product code and backlogs, let's start by creating a new Azure DevOps project. In this snippet I use my organization: "psibrorg", replace that with your own and choose if you want to leave the project public or make it private.

az devops project create --name "Azure IaaS Series" --org https://dev.azure.com/psibrorg --visibility public

When we create a new project it creates a default git repository of the same name which works great for us.

mkdir "Azure IaaS Series"
git init

# Create a readme file
"#Azure IaaS Series" > readme.md

git add .
git commit -m "Initial commit"

# Add the default repo as the upstream origin
git remote add origin (az repos list --project "Azure IaaS Series" --org https://dev.azure.com/psibrorg --query [0].webUrl)

git push -u origin master

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay