In this blog, we will see how to get started with Azure DevOps for an Infrastructure background person.
We will familiarise ourselves with deploying your Azure resources with ARM templates by using Azure DevOps with Continuous Integration (CI) and Continuous Deployment (CD).
I have made this entire post into two parts for easier understanding:
Part 1: Creating your first project in Azure DevOps
Part 2: Enabling the first project in Azure DevOps for Continuous Integration (CI) / Continuous Deployment (CD).
This article will focus on Part 1. The things needed to make this successful include:
- Visual Studio software (Free edition) – you can get this from https://visualstudio.microsoft.com
- Azure Subscription access. If not, you can create a free Azure account.
- An account in Visual Studio. if you don`t have one create a new account by signing into https://visualstudio.microsoft.com and enabling Azure DevOps service.
- Click on Azure DevOps and select sign in.
- Once you sign in with your Microsoft account, click continue.
Creating the first project in Azure DevOps: When you log into Azure DevOps (https://dev.azure.com) for the first time with your MSDN/Microsoft account.
- Now, click on new project and provide the name (Eg: Firstproject) & add a description for the project.
- Select visibility options: Private (with this setting, only you can access the content. You can provide access to people who can able to view this project.)
- Under Firstproject , Click on Repos.
- Since the project folder is empty, we need to create a new file. We can use Visual studio for creating it and click on clone in Visual studio options:
- Visual studio software will open its console.
- Provide your Microsoft account credentials, which has been used for Azure DevOps and Azure account.
- The project needs to be cloned on local disk. Click on clone.
- This will pop-up for Azure DevOps credentials.
- This may result in authentication failed or fatal error. To resolve this, follow below steps:
- In Visual studio, select team explorer and select manage connections and click connect to project.
- Select your user id for Azure DevOps and provide credentials. Then your Project (First project) will be listed for connect.
- Now you will get clone options:
- On Team Explorer view, click on Create a new project or solution in this repository.
- Select Installed -> cloud and Azure Resource group
- Select Blank template for deployment.
- Select solution explorer view on Visual Studio
- Select AzureResourceGroup and click on Azuredeploy.json
- Click on Resources on Json outline and select virtual network for deployment. provide name for vnet : eg firstnetwork01
- On the bottom of Visual Studio, you find the number of changes icon has been performed to it. Click on it for commit changes.
- Provide comments for commit and select commit all.
- The change has been committed locally and we need to push the changes to Azure DevOps project file. Click on sync for change.
- Click on push for changes to cloud (Azure DevOps).
- Now, go back to Azure DevOps portal and select your project (First project) and select repos.
- You will able to find your AzureResourceGroup, which you created on Visual Studio will be available.
- Click on Azuredeploy.json file to verify your file.
Enabling deployment of ARM Template in Azure DevOps:
- Log on Azure DevOps portal and open Firstproject (your project name), then click on Builds.
- On the new page, click on New Pipeline. Select “Use the visual designer to create a pipeline without YAML”.
- Ensure your project & repository is selected and click on continue.
- Select “Start with an Empty Job”
- Click on + item on Agent Job.
- On the new pane, select deploy and click on Azure Resource Group deployment and click ADD.
- On the left pane, select Azure Deployment: Create or Update Resource Group action on
- Select Azure Subscription and click on Authorize.
- Select your resource group on your Azure subscription and location.
- The template location will be linked artefact.
- Select your template file (azuredeploy.json) from the selection menu.
- Select your template parameter file (azuredeploy.parameters.json) from the selection menu.
- Deployment mode: complete.
- Click save and queue and provide your comment on the file changes.
- After it has saved, the build operation will commence deployment on your Azure tenant.
- You can view the deployment logs from the Azure DevOps portal. In addition, you will receive an email (email which has been used for Azure DevOps account) with deployment status.
- Verify your network (Azure Resource which we added on ARM template) has been created on Azure tenant.
This concludes Part 1 creating and deploying ARM templates with Azure DevOps.
In Part 2, I take you through on enabling Continuous Integration (CI) / Continuous Deployment (CD).