An introduction to Terraform with Azure

  • Written By Arun Vangala
  • 25/02/2020

What is Terraform?

Terraform is a utility for managing infrastructure as code; it works across most cloud providers with on premise infrastructure platforms as a service (iPaaS). We use Terraform when we want to rapidly deploy the infrastructure (for example in disaster recovery).

Terraform uses declarative configuration files meaning they can be managed just like any other in the environment. They can be stored in source control, shared, versioned and deleted. The way the configuration files are structured simplifies mapping multiple resources and dependencies together. Terraform is modular, and allows for a central deployment to be used with multiple providers, thereby not limiting an organisation to just one platform.

Terraform on AZURE

Terraform integrates with Azure and Azure DevOps, enabling teams to integrate infrastructure as code for managing Azure resources directly into the build, and release automation pipelines. There are different kinds of components like Azure virtual machines, virtual networks, subnets, and Azure Kubernetes services that can be deployed through Terraform.

Terraform is configured using plugins which you can enable once you download and install the executable file on your machine.

Terraform plugins are built into the Azure CLI and PowerShell tools within the Azure portal. Regardless of the tool the respective Terraform plugin will help directly validate and deploy your Terraform module. As it has interactive login we can use Azure CLI authentication during the development or testing phase.

How do I deploy Infrastructure to Azure?

  1. Create a Terraform module of *.tf files and dependent configuration files.
  2. Terraform initialisation.
  3. Azure authentication.
  4. Terraform deployment, state file creation.
  5. Terraform execution plan.
  6. Apply the plan.

CI/CD with Azure Terraform


We can build a CI/CD pipeline using Terraform and Azure DevOps. With the help of a CI/CD pipeline we can deploy your infrastructure and test the environment at the same time. We can integrate the terraform with both Docker and Kubernetes.

Terraform Use Cases

  • Multi-Cloud Deployment

Terraform is cloud-agnostic and allows single configuration to be used with multiple cloud providers and cross-cloud dependencies. This helps in building and managing large-scale multi-cloud infrastructures.

  • Multi-Tier Applications

Terraform can be used in building and managing N-tier architecture, which is a combination of an interdependent pool of webservers, API-servers, load balancers and database servers etc. This infrastructure can be scaled using Terraform’s inbuilt features.

  • Software Defined Networking

Terraform can be used to codify the configuration for SDN; this can be used to automate the setup of Azure and Azure network components.

  • Disposable Environments

With Terraform we can codify the production environment and then use the Terraform modules with staging, QA or dev, so that we can rapidly deploy and test the new environment (which we can then dispose if we do not need it). With this process we can maintain parallel environments.

  • Software Demos

Software developers can use the features of Terraform to quickly deploy the software on the infrastructure created by Terraform, and easily demo the software and test.

  • Self-Service Clusters

All the services (resources) can be codified in a configuration, where we share the code within different teams in the organisation and use those artifacts to manage different customer infrastructure requirements.

If you would like to find out more about Azure our Big Data experts can help you.  Do give us a call at +44 (0)203 475 7980 or email us at marketing@whishworks.com

 Other useful links:

The use of Data in 2020 and beyond

WHISHWORKS Case Studies

WHISHWORKS partners with Microsoft Azure

Latest Insights

Salesforce CRM for the public sector
Blogs

CRM for Citizen Relationship Management

While the times have been changing for a while, current events have accelerated the need for public agencies to adapt to a changing world.

Open banking APIs
Blogs

Open Banking – How APIs are fast-tracking growth

When it comes to reaching market faster and scaling with both speed and stability, APIs have been a crucial component of many Fintechs.

Big Data Investment Drivers
Blogs

Key drivers of Big Data investment in 2020

Since 2019, key developments such as COVID-19 have influenced investment trends in Big Data. Drawing on insights from WHISHWORKS’ Big Data Report 2020 we outline the key drivers of investment in Big Data this year.