Sunday, June 20, 2021

New YAML Template Editing Experience in Azure DevOps

Continuous integration and delivery is a mandatory part of today's software development process which can be implemented using several CI/CD tools. Azure DevOps is a tool which can be used to create CI/CD pipelines as classical pipeline or as  YAML pipeline. When you are using YAML pipelines, you might need to use several YAML templates to create a CI/CD pipeline. If you need to do any modifications to the templates, previously you had to select relevant template from the Repo and do the modifications. However, Azure DevOps has introduced new YAML template editor feature which can be used to edit YAML templates easily. 

This blog explains how to work with YAML template editor.

Let's get started.

Wednesday, June 9, 2021

Modifying Existing Task Groups with the Minimal Impact to Existing Pipelines

Azure DevOps task group is used to group and manage multiple pipeline tasks as a reusable component. While you are working in your projects, there can be requirements to edit existing task group. But, if you directly edit the task group, multiple pipelines get affected by the changes. So, This blog explains how to edit a task group with minimum affect to the existing pipelines.

Prerequisites: 

  • Azure DevOps task group use in a pipeline

Let's get started.

Go to Azure DevOps task group section and select a task group. Do changes to the task group and save task group as draft.

Saturday, May 22, 2021

Get Response Status Code with PowerShell Invoke-RestMethod

 As DevOps engineers, you get requirements to do scripts to perform several actions on application or get status of the application backend  using API calls. This post explains small issue that we experience while writing PowerShell scripts to trigger APIs.

Issue: Invoke-RestMethod cannot be used to get the return HTTP status from the API. API call failed with mentioning -StatusCodeVariable  is not valid. You can learn more about Invoke-RestMethod from here.

Wednesday, May 19, 2021

Run PowerShell script automatically after reboot

If you are working with scripting languages, you might have to do various scripts to fulfill requirements such as reboot the machine in the middle of installation until installation fully done. As scenario, You can think of Windows updates and the Reboot and check for further updates. This blog explains how to achieve it using schedule tasks.

Let's try to understand the script step by step.

  • Following first few lines of the script is for make sure the script is run as administrator.




Sunday, April 18, 2021

Secure Azure Virtual Machines Behind Azure Firewalls

Data Security is one of the most important concern of the IT industry. Hence, each individual of the project team is responsible for the security and encryption of the data. However, as OPS engineers, you have to introduce several data security mechanisms to your company. This blog post explains how to access the Azure Virtual Machine securely. 

Pre requisite: 

  • Azure Virtual Machine
  • Web app hosted in the IIS server inside the Azure Virtual machine
  • Network configurations are done to make Web app accessible from the outside of the VM
  • Azure firewall 

As the first step to secure the VM, we remove the public IP from the VM, go to public ip of the VM and click on Dissociate.

Wednesday, March 24, 2021

Adding AAD user to Azure SQL via Terraform

You might have heard about various authentication mechanisms are used for database access management securely. Azure SQL server also has its own authentication mechanism as single administer account which has control over the entire server. Other than this super admin, you can create second administrator account as Azure AD account. You can easily add AAD (Azure Active Directory) users as  admin to Azure SQL via the Azure portal. However, if you want to deploy Azure SQL server via IaC let's look at using Terraform to add an AAD user as admin to the Azure SQL in this blog.

We can create resource group, Azure Key Vault to store SQL server password, Azure SQL server, Azure AD group using Terraform script. Main.tf of the sample script as follows.

Saturday, March 20, 2021

IaC with Terraform for Shared Azure Resources in Multiple Subscriptions

 While you are working with multiple azure subscriptions there might be situations where you need to share infrastructure in more than one subscription. If you try to automate such situation, you can achieve that using Terraform as explained in this post.

Pre-requisites: 

  • User should have access to at least two azure subscriptions
  • Create resource group in one subscription.

Saturday, January 23, 2021

Manageable Infra scripts with Terraform for-each

While we are working on IT projects, you might get requirements such as provisioning hundreds of app services for a project. If you choose to do that task manually, that would get long time to complete the task. As a solution, we can use Infrastructure automation tools such as Azure CLI, ARM template, Terraform, etc. However, we need to write these Infa scripts well organized manner and manageable way. Otherwise, you will get into more trouble of maintaining long and repetitive scripts.

Terraform has several ways such as modules and loops to reduce number of lines of the script. In this blog, we will be discussing the for-each loop of the Terraform.

In the following sample we use main.tf and variable.tf files.  Three app service plans and three app services will be created using the script. Let's go thought the Main.tf file to understand how we define the for-each.