Setting up your Azure DevOps basics

Setting up your Azure DevOps basics

Hello everyone!

When you want to deploy something in code, then Azure DevOps is the best tool to manage your infrastructure with code. This post will show you how to start with Infrastructure as Code and give you guidelines to start out with an organized environment in the cloud.

Prerequisites

  • Microsoft account
  • Azure subscription (Azure DevOps is free, but I will connect to Azure)
  • Contributor or Owner role on the subscription (less rights are possible, but take more time to setup)
  • Application Administrator or Global Administrator
  • Azure CLI version 2.4 or higher
  • Visual Studio Code (Feel free to use any coding tool you want)

Setting up your organization

  1. First you need to have a Microsoft account to setup the Azure DevOps environment with the following Microsoft link: https://azure.microsoft.com/services/devops/
  2. After you follow the sign-up process the organization will be created and if you do have signed up with a newly created Microsoft account, then the project will be created for you. May be this is not the name what you want, but this name can be changed if you click on the bottom left on Project Settings.

Setting up projects

The project could be setup already, but it is also very easy to create projects with Azure CLI. The following line of code will easily create the project for you.

  1. First we need to login into the right tenant with az login
  2. Authorize your session and select the right account for the tenant you want to manage. You see the following window and within VSCode the following screen.
  1. Now you can run the following line of code to create your project. The organization URL needs to be changed in this line of code.
az devops project create --name BiCepAVD --description "Deploy AVD Infrastructure with code" --org https://dev.azure.com/xxxxxxxxxxx/ --process Agile --source-control  git --output table
  1. As you can see the project is created within Azure DevOps.

Creating service connections

The project is in place so you can now create the service connection that has access to your Azure tenant and is needed to run the pipelines. This can be created automatically from the Azure DevOps portal when you click on Project Settings and go to Service connections and use Azure Resource Manager and then Workload Identity federation (automatic) and fill in the fields, the resource group is not necessary. Afterwards the Service Connection will be visible in the list of service connections.

Next steps for the deployment

Now the Azure DevOps environment is ready to use with a code repo. In the next blog I will show you how to setup some pipelines with YAML and create bicep templates to start deploying your code.

Final Thoughts

This post will show you the steps to start out with Azure DevOps. This topic can be very complex, but working in the cloud with Azure DevOps is easy to setup. The coding part is more difficult of course, but I will show you that YAML and bicep can be easy to manage as well. Feel free to comment on my post!

Author

  • Mischa Sachse

    Mischa Sachse is one of the founders of the Cloud Experts Community. Would you like to join in the fun? Make sure to contact him via the mail button below or find out more about him on his personal website.

Leave a Reply

Your email address will not be published. Required fields are marked *