Skip to content

Automation of Infrastructure deployment to Azure implemented with Terraform and Azure DevOps

Notifications You must be signed in to change notification settings

josema88/IaCWithAzure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

IaCWithAzure

This is a sample that allows to create infrastructure in Azure cloud using IaC concept with tools such as Terraform, Ansible and Azure Resource Manager.

  • Type some Markdown on the left
  • See HTML in the right
  • Magic

Requirements

Create Azure DevOps Project

You must create your Azure DevOps project that will contain the automated pipelines that deploy the infraestructure to the cloud. Where I use {YOURORG}, you'll replace with the organization that you create.

Create New Organization

AzDevops1

AzDevops2

Create Project

  • Create the first project - name it AzBootCamp2019

Authorize your Azure Cloud subscription

  • Add a service connection for your Azure Subscription AzDevops3

Create Automated Pipeline

After you create your organization and project within Azure Devops you can proceed to create your automated pipeline.

Create a Release Pipeline

  • Create a new Release Pipeline AzDevops4
  • Add an artifact, in this case your Github repo where your terraform code is hosted. You should add a new connection to your github in services management. AzDevops5
  • Add a stage, e.g.: Dev or Prod. This stage should be an empty job. AzDevops6 AzDevops7 AzDevops8

Create Terraform Backend Task

Select the Azure CLI task. Select the Azure subscription from the drop-down list and click Authorize to configure Azure service connection. Get your automation script from the repo. Note that the bash script will receive some arguments. AzDevops9 AzDevops10

By default, Terraform stores state locally in a file named terraform.tfstate. When working with Terraform in a team, use of a local file makes Terraform usage complicated. With remote state, Terraform writes the state data to a remote data store. Here we are using Azure CLI task to create Azure storage account and storage container to store Terraform state. For more information on Terraform remote state click here

About

Automation of Infrastructure deployment to Azure implemented with Terraform and Azure DevOps

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published