SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Deploying Azure DevOps
using Terraform
Lessons Learned
Agenda
• Microsoft’s Investments in Terraform
• AzureRM Terraform Provider Roadmap
• Terraform vNext
• Azure DevOps Components Breakdown
• Resources
Microsoft’s investments in Terraform
• Microsoft Team HashiCorp Team
• Terraform AzureRM Provider updates
• Latest release (August 5, 2020)
enhancements/bug fixes
releases/updates published in July alone!
• Terraform Module Registry
• https://registry.terraform.io/browse/modules?provider
=azurerm
Roadmap
https://github.com/terraform-providers/terraform-provider-azurerm
Terraform v0.13 highlights
• Support for , , and
• New syntax
• Custom
command connects a CLI user
to the Terraform Cloud app
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "2.0.0"
}
}
}
variable "image_id" {
type = string
description = "The id of the machine image (AMI) to use for the server."
validation {
condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-"
error_message = "The image_id value must be a valid AMI id, starting with "ami-"."
}
}
Azure DevOps Component Breakdown
• Project
• Repository
• Variable Groups
• Pipelines
• Service Endpoints
• Boards
• Environments
• Releases
• Test plans
• Artifacts
Can’t deploy (yet):Can deploy:
Environment Variables
• $ENV:AZDO_PERSONAL_ACCESS_TOKEN = 'SomeBigLongGUID'
• $ENV:AZDO_ORG_SERVICE_URL = 'https://dev.azure.com/AdinErmie'
• $ENV:AZDO_GITHUB_SERVICE_CONNECTION_PAT = 'SomeOtherGUID'
• ADO Personal Access Token
• Used to allow you current execution credentials permission into you DevOps Org (via
the API), to create a new ADO Project
• Use personal access tokens
• ADO Organization Service URL
• Simply, the Org URL (because you’re making a new project inside an existing Org, not
a new Org)
• GitHub Service Connection Personal Access Token
• Used for acceptance testing
Azure DevOps Project
Azure DevOps Repository
Azure DevOps Variable Groups
Azure DevOps Pipelines
Azure DevOps Service Endpoints
Azure DevOps Service Endpoints
OAuth
Azure DevOps Service Endpoints
Personal Access Token (PAT)
Azure DevOps Service Endpoints
GitHub App
Let’s see it in action!
Lessons Learned
• You need to pre-create storage account where you will store the TF State file for the creation of the ADO
project
• Unless you create it using Terraform, and then use terraform import to bring it under Terraform
control/management
• Importing a public OR private GitHub repo is not yet supported
• Creating Service Endpoints is confusing
• Unsure how to ‘authorize’ the Azure service connection with permissions on the Key Vault (for existing SPNs)
• For demo simplicity, set the Key Vault default network access control to ‘allow’
• Not a best-practice, but unless you’re VPN’d into a VNET that has access to the KV, you won’t be able to
see any keys/secrets
• SPN password (if used to pass into the Terraform command-line via pipeline), does not like $p3c1@l (special)
characters
Lessons Learned
(continued)
• If you define a new repo, and then
attempt to define the pipeline via code,
but the YAML file doesn’t already
existing in the repo (because they’re
not pushed to it), you’ll encounter the
error “File FILENAME.yml not found in
repository REPO NAME”
(more) Lessons Learned
• Currently not supported to
programmatically (through Terraform)
grant the Pipeline access to the Service
Connection
• Issue #41 - Authorize service
connection use by pipeline via
Terraform
Resources
Gotta learn
Bonus! TFLint
• A part of the GitHub Super Linter
• One linter to rule them all
• Used to validate against issues
• Focused on possible errors, , etc.
• Support for all providers
• Rules that warn against
• AWS = 700+ rules
• Azure = 279 rules (Experimental support)
• GCP = WIP
Resources
• Adin’s personal curated list of Terraform resources
• Automating infrastructure deployments in the Cloud with Terraform
and Azure Pipelines
• Deploying Terraform Infrastructure using Azure DevOps Pipelines Step
by Step
Don’t forget about these Visual Studio
Code (VS Code) extensions:
 Azure Terraform (by Microsoft)
 Terraform (by Mikael Olenfalk)
 Now owned by HashiCorp!
Certification resources
• HashiCorp Terraform Certified Associate Preparation Guide
(co-authored by Adin Ermie and Ned Bellavance)
• Study Guide - Terraform Associate Certification
(HashiCorp official)
• Exam Review - Terraform Associate Certification
(HashiCorp official)
• Sample Questions - Terraform Associate Certification
(HashiCorp official)
This is me
Adin Ermie
• Cloud Solution Architect – Azure Infrastructure @ Microsoft
• Azure Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS)
• Cloud Management & Security
• Azure Monitor, Azure Security Center (ASC) / Azure Sentinel
• Cloud Governance
• Azure Policy, Blueprints, Management Groups, and Azure Cost
Management (ACM)
• Business Continuity and Disaster Recovery (BCDR)
• Azure Site Recovery (ASR) / Azure Migrate, and Azure Backup
• Infrastructure-as-Code (IaC)
• Azure Resource Manager (ARM), and Terraform
• 5x MVP - Cloud and Datacenter Management (CDM)
• 1x HCA – HashiCorp Ambassador
Adin.Ermie@outlook.com
@AdinErmie
https://AdinErmie.com
linkedin.com/in/adinermie
https://github.com/AErmie

More Related Content

What's hot (20)

PPTX
Terraform
Phil Wilkins
 
PPTX
Infrastructure-as-Code (IaC) using Terraform
Adin Ermie
 
PPTX
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Adin Ermie
 
PPTX
Comprehensive Terraform Training
Yevgeniy Brikman
 
PPTX
Terraform on Azure
Mithun Shanbhag
 
PDF
Building infrastructure as code using Terraform - DevOps Krakow
Anton Babenko
 
PDF
Terraform Best Practices - DevOps Unicorns 2019
Anton Babenko
 
PDF
Deploy resources on Azure using IaC (Azure Terraform)
George Grammatikos
 
PDF
Terraform introduction
Jason Vance
 
PPTX
Terraform
Adam Vincze
 
PDF
Terraform -- Infrastructure as Code
Martin Schütte
 
PDF
Infrastructure as Code
Albert Suwandhi
 
PDF
Terraform modules and (some of) best practices
Anton Babenko
 
PPTX
Terraform on Azure
Julien Corioland
 
PDF
Introduction to Vault
Knoldus Inc.
 
PPTX
Terraform Basics
Mohammed Fazuluddin
 
PDF
Vault 101
Hazzim Anaya
 
PPTX
Terraform
Harish Kumar
 
PDF
Best Practices of Infrastructure as Code with Terraform
DevOps.com
 
PPT
Docker introduction
Phuc Nguyen
 
Terraform
Phil Wilkins
 
Infrastructure-as-Code (IaC) using Terraform
Adin Ermie
 
Infrastructure-as-Code (IaC) Using Terraform (Advanced Edition)
Adin Ermie
 
Comprehensive Terraform Training
Yevgeniy Brikman
 
Terraform on Azure
Mithun Shanbhag
 
Building infrastructure as code using Terraform - DevOps Krakow
Anton Babenko
 
Terraform Best Practices - DevOps Unicorns 2019
Anton Babenko
 
Deploy resources on Azure using IaC (Azure Terraform)
George Grammatikos
 
Terraform introduction
Jason Vance
 
Terraform
Adam Vincze
 
Terraform -- Infrastructure as Code
Martin Schütte
 
Infrastructure as Code
Albert Suwandhi
 
Terraform modules and (some of) best practices
Anton Babenko
 
Terraform on Azure
Julien Corioland
 
Introduction to Vault
Knoldus Inc.
 
Terraform Basics
Mohammed Fazuluddin
 
Vault 101
Hazzim Anaya
 
Terraform
Harish Kumar
 
Best Practices of Infrastructure as Code with Terraform
DevOps.com
 
Docker introduction
Phuc Nguyen
 

Similar to Deploying Azure DevOps using Terraform (20)

PPTX
Integration-Monday-Terraform-Serverless
BizTalk360
 
PDF
Learn Terraform on Azure
Jorn Jambers
 
PDF
Terraform modules and best-practices - September 2018
Anton Babenko
 
PDF
Terraform: Infrastructure as Code
Pradeep Bhadani
 
PDF
20170831 - Greg Palmier: Terraform & AWS at Tempus
DevOps Chicago
 
PDF
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
Puppet
 
PPTX
BSidesDFW2022-PurpleTeam_Cloud_Identity.pptx
JasonOstrom1
 
PDF
Zure Azure PaaS Zero to Hero - DevOps training day
Okko Oulasvirta
 
PDF
DevOps for Databricks
Databricks
 
PDF
Containerised ASP.NET Core apps with Kubernetes
Codemotion Tel Aviv
 
PPTX
Infrastructure as Code Presentation v5.pptx
YASHSRIVASTAVA811639
 
PDF
Terraform - Taming Modern Clouds
Nic Jackson
 
PPTX
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
PPTX
Terraform Modules and Continuous Deployment
Zane Williamson
 
PPTX
T5 - Mise en place de votre processus DevOps Ofice, Office 365, SharePoint - ...
SPS Monaco
 
PDF
Infrastructure as Code with Terraform
Tim Berry
 
PPTX
Azure enterprise integration platform
Michael Stephenson
 
PPTX
Sps monaco vincent biret spfx devops
Vincent Biret
 
PDF
Mete Atamel
CodeFest
 
PPTX
The ABC's of IaC
Steven Pressman, CISSP
 
Integration-Monday-Terraform-Serverless
BizTalk360
 
Learn Terraform on Azure
Jorn Jambers
 
Terraform modules and best-practices - September 2018
Anton Babenko
 
Terraform: Infrastructure as Code
Pradeep Bhadani
 
20170831 - Greg Palmier: Terraform & AWS at Tempus
DevOps Chicago
 
PuppetConf 2017: Unlocking Azure with Puppet Enterprise- Keiran Sweet, Source...
Puppet
 
BSidesDFW2022-PurpleTeam_Cloud_Identity.pptx
JasonOstrom1
 
Zure Azure PaaS Zero to Hero - DevOps training day
Okko Oulasvirta
 
DevOps for Databricks
Databricks
 
Containerised ASP.NET Core apps with Kubernetes
Codemotion Tel Aviv
 
Infrastructure as Code Presentation v5.pptx
YASHSRIVASTAVA811639
 
Terraform - Taming Modern Clouds
Nic Jackson
 
#ESPC18 How to do #devops with the #SharePoint Framework and why it matters?
Vincent Biret
 
Terraform Modules and Continuous Deployment
Zane Williamson
 
T5 - Mise en place de votre processus DevOps Ofice, Office 365, SharePoint - ...
SPS Monaco
 
Infrastructure as Code with Terraform
Tim Berry
 
Azure enterprise integration platform
Michael Stephenson
 
Sps monaco vincent biret spfx devops
Vincent Biret
 
Mete Atamel
CodeFest
 
The ABC's of IaC
Steven Pressman, CISSP
 
Ad

Recently uploaded (20)

PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
PDF
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
PDF
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
DOCX
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PPTX
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
PDF
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PDF
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PDF
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
PDF
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
Kubernetes - Architecture & Components.pdf
geethak285
 
My Journey from CAD to BIM: A True Underdog Story
Safe Software
 
Redefining Work in the Age of AI - What to expect? How to prepare? Why it mat...
Malinda Kapuruge
 
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
 
Automating the Geo-Referencing of Historic Aerial Photography in Flanders
Safe Software
 
Daily Lesson Log MATATAG ICT TEchnology 8
LOIDAALMAZAN3
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
Reimaginando la Ciberdefensa: De Copilots a Redes de Agentes
Cristian Garcia G.
 
5 Things to Consider When Deploying AI in Your Enterprise
Safe Software
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
TrustArc Webinar - Navigating APAC Data Privacy Laws: Compliance & Challenges
TrustArc
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
99 Bottles of Trust on the Wall — Operational Principles for Trust in Cyber C...
treyka
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
 
Hello I'm "AI" Your New _________________
Dr. Tathagat Varma
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
Ad

Deploying Azure DevOps using Terraform

  • 1. Deploying Azure DevOps using Terraform Lessons Learned
  • 2. Agenda • Microsoft’s Investments in Terraform • AzureRM Terraform Provider Roadmap • Terraform vNext • Azure DevOps Components Breakdown • Resources
  • 3. Microsoft’s investments in Terraform • Microsoft Team HashiCorp Team • Terraform AzureRM Provider updates • Latest release (August 5, 2020) enhancements/bug fixes releases/updates published in July alone! • Terraform Module Registry • https://registry.terraform.io/browse/modules?provider =azurerm
  • 5. Terraform v0.13 highlights • Support for , , and • New syntax • Custom command connects a CLI user to the Terraform Cloud app terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "2.0.0" } } } variable "image_id" { type = string description = "The id of the machine image (AMI) to use for the server." validation { condition = length(var.image_id) > 4 && substr(var.image_id, 0, 4) == "ami-" error_message = "The image_id value must be a valid AMI id, starting with "ami-"." } }
  • 6. Azure DevOps Component Breakdown • Project • Repository • Variable Groups • Pipelines • Service Endpoints • Boards • Environments • Releases • Test plans • Artifacts Can’t deploy (yet):Can deploy:
  • 7. Environment Variables • $ENV:AZDO_PERSONAL_ACCESS_TOKEN = 'SomeBigLongGUID' • $ENV:AZDO_ORG_SERVICE_URL = 'https://dev.azure.com/AdinErmie' • $ENV:AZDO_GITHUB_SERVICE_CONNECTION_PAT = 'SomeOtherGUID' • ADO Personal Access Token • Used to allow you current execution credentials permission into you DevOps Org (via the API), to create a new ADO Project • Use personal access tokens • ADO Organization Service URL • Simply, the Org URL (because you’re making a new project inside an existing Org, not a new Org) • GitHub Service Connection Personal Access Token • Used for acceptance testing
  • 12. Azure DevOps Service Endpoints
  • 13. Azure DevOps Service Endpoints OAuth
  • 14. Azure DevOps Service Endpoints Personal Access Token (PAT)
  • 15. Azure DevOps Service Endpoints GitHub App
  • 16. Let’s see it in action!
  • 17. Lessons Learned • You need to pre-create storage account where you will store the TF State file for the creation of the ADO project • Unless you create it using Terraform, and then use terraform import to bring it under Terraform control/management • Importing a public OR private GitHub repo is not yet supported • Creating Service Endpoints is confusing • Unsure how to ‘authorize’ the Azure service connection with permissions on the Key Vault (for existing SPNs) • For demo simplicity, set the Key Vault default network access control to ‘allow’ • Not a best-practice, but unless you’re VPN’d into a VNET that has access to the KV, you won’t be able to see any keys/secrets • SPN password (if used to pass into the Terraform command-line via pipeline), does not like $p3c1@l (special) characters
  • 18. Lessons Learned (continued) • If you define a new repo, and then attempt to define the pipeline via code, but the YAML file doesn’t already existing in the repo (because they’re not pushed to it), you’ll encounter the error “File FILENAME.yml not found in repository REPO NAME”
  • 19. (more) Lessons Learned • Currently not supported to programmatically (through Terraform) grant the Pipeline access to the Service Connection • Issue #41 - Authorize service connection use by pipeline via Terraform
  • 21. Bonus! TFLint • A part of the GitHub Super Linter • One linter to rule them all • Used to validate against issues • Focused on possible errors, , etc. • Support for all providers • Rules that warn against • AWS = 700+ rules • Azure = 279 rules (Experimental support) • GCP = WIP
  • 22. Resources • Adin’s personal curated list of Terraform resources • Automating infrastructure deployments in the Cloud with Terraform and Azure Pipelines • Deploying Terraform Infrastructure using Azure DevOps Pipelines Step by Step Don’t forget about these Visual Studio Code (VS Code) extensions:  Azure Terraform (by Microsoft)  Terraform (by Mikael Olenfalk)  Now owned by HashiCorp!
  • 23. Certification resources • HashiCorp Terraform Certified Associate Preparation Guide (co-authored by Adin Ermie and Ned Bellavance) • Study Guide - Terraform Associate Certification (HashiCorp official) • Exam Review - Terraform Associate Certification (HashiCorp official) • Sample Questions - Terraform Associate Certification (HashiCorp official)
  • 24. This is me Adin Ermie • Cloud Solution Architect – Azure Infrastructure @ Microsoft • Azure Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS) • Cloud Management & Security • Azure Monitor, Azure Security Center (ASC) / Azure Sentinel • Cloud Governance • Azure Policy, Blueprints, Management Groups, and Azure Cost Management (ACM) • Business Continuity and Disaster Recovery (BCDR) • Azure Site Recovery (ASR) / Azure Migrate, and Azure Backup • Infrastructure-as-Code (IaC) • Azure Resource Manager (ARM), and Terraform • 5x MVP - Cloud and Datacenter Management (CDM) • 1x HCA – HashiCorp Ambassador [email protected] @AdinErmie https://AdinErmie.com linkedin.com/in/adinermie https://github.com/AErmie

Editor's Notes

  • #10: NOTE: The public documentation incorrectly shows an example of Import, even though the feature is not actually available yet!