0% found this document useful (0 votes)
21 views6 pages

WWW Coachdevops Co...

Uploaded by

Linux Routes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views6 pages

WWW Coachdevops Co...

Uploaded by

Linux Routes
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

더보기 블로그 만들기 로그인

DevOps + Cloud Computing


Coaching
Hands on DevOps Coaching that is provided on AWS and Azure Cloud platforms. Contact me at
devops.coaching@gmail.com for more info. You can directly reach out to Coach AK at +1(469) 733-5248

Thursday, March 3, 2022 Search This Blog

Search
How to store Terraform state file in Azure Storage | How to
manage Terraform state in Azure Blob Storage | Terraform Contact the Coach
Remote state in Azure Blob storage | Terraform backend Click To Register for a Devops and Cloud
Course
One of the amazing features of Terraform is, it tracks the infrastructure that you provision. It does
Join WhatsApp Group for Course Enquiry
this through the means of state. By default, Terraform stores state information locally in a file
DevOps Bootcamp Schedule
named terraform.tfstate. This does not work well in a team environment where if any
About the Coach & Coaching Model
developer wants to make a change he needs to make sure nobody else is updating terraform in
the same time. You need to use remote storage to store state file.
Contributors
With remote state, Terraform writes the state data to a remote data store, which can then be
shared between all members of a team. Terraform supports storing state in many ways including Amy
the below: Amy

Terraform Cloud DevOps Coach

HashiCorp Consul
Amazon S3 Blog Archive
Azure Blob Storage

► 2024 (43)
Google Cloud Storage

► 2023 (62)
Alibaba Cloud OSS

▼ 2022 (42)
Artifactory or Nexus

► December (3)
We will learn how to store state file in Azure Blob storage. We will be creating Azure storage ►
► November (3)
account and container.

► October (2)

► September (6)

► August (4)

► July (2)

► June (1)

► May (10)

► April (1)

▼ March (2)
Install Jenkins on Ubuntu 22.0.4 using
Docker Comp...
How to store Terraform state file in Azure
Storage...


► February (2)

► January (6)


► 2021 (52)

► 2020 (81)

► 2019 (51)

► 2018 (12)

Labels
Watch the steps in YouTube channel: ACR
Admin password
How to store Terraform state file in Azure Storage |…
|… AKS
Share
Ansible
Ansible Roles
Apache
Appservice
Appservices
Artifactory
Automation
AWS
AWS CLI
Azure
Azure App Service

Watch on Azure Blob storage


Azure Build Pipelines
Azure CLI
Pre-requisites:
Azure Cloud
Install Azure CLI Azure DevOps
Make sure Terraform is setup on your local machine Azure DevOps integration
Azure subscription Azure DevOps integration
Authenticate Terraform with Azure using Azure CLI. Azure DevOps pipeline
Azure Git
Steps:
Azure pipelines
Logging into the Azure Cloud Azure VM
Best Practice
Login into the Azure Cloud using Azure CLI using:
Best practices for securing Azure DevOps
Pipelines
az login
Binary Repo
enter your microsoft username and password to login to Azure cloud
BitBucket
Create main.tf Boto
terraform {
branch
required_providers {
Build Agents
azurerm = {
Checklist
source = "hashicorp/azurerm"
CI/CD
version = "=2.63.0"
} CICD

} Code Quality
} Container Registry
Containers
provider "azurerm" { create VM in Azure
features {} Declarative
} DevOp coaching schedule
DevOps
resource "azurerm_resource_group" "demo-rg" {
Devops Best Practices
name = "demo-resource-group"
DevOps BootCamp
location = "eastus"
DevOps Coaching
}
DevOps coaching in Plano Frisco area
DevOps Coaching Plano
DevOps interview Prep
DevOps Interview Questions
terraform init
DevOps Interview Tips
terraform plan DevOps Skills
this will show it will create one resource DevOps Tips
DevOps Tools
DevOps Training
DevOps Training Dallas
DevOps Training Frisco
Devops Training in Dallas
DevOps Troubleshooting
Dock
Docker
Docker Compose
Docker Registry
DockerHub
EC2
EC2 bootstrap
Ec2 Creation
terraform apply EC2 instance
Now this will create a local terraform state file in your machine. ECR
EKS
eksctl
Elastic IP
Freestyle job CICD
Git
GitHub
GitHub Actions
GitHub Runners
GitLab
Grafana
Helm
Helm3
How to connect to EC2 instance
IAC
How to store Terraform state file remotely?
IAM
Step # 1 - Configure Azure storage account
Infrastructure

Before you use Azure Storage as a backend, you must create a storage account. We will create Infrastructure Automation
using shell script: Install Nexus on Ubuntu
install terraform
#!/bin/bash
Integrate ACR with AKS
RESOURCE_GROUP_NAME=tfstate
STORAGE_ACCOUNT_NAME=tfstate$RANDOM Java
CONTAINER_NAME=tfstate Jenkins
# Create resource group
Jenkins integration
az group create --name $RESOURCE_GROUP_NAME --location eastus
# Create storage account Jenkins pipeline
az storage account create --resource-group $RESOURCE_GROUP_NAME --name Jenkins Pipelines
$STORAGE_ACCOUNT_NAME --sku Standard_LRS --encryption-services blob
# Create blob container JFrog
az storage container create --name $CONTAINER_NAME --account-name K8S
$STORAGE_ACCOUNT_NAME kubectl

This should have created resource group, storage account and container in Azure portal. Kubernetes
Kubernetes Error
LAMP
Linux
MAC OS
MacOS
Master slave setup
Maven
MFA
Microservices
Migration
Monitoring
Nexus
Nexus 3
Nexus3
Parallelism
Password Reset for SonarQube
PHP
Step # 2 - Configure terraform backend state
Pipeline
Pipelines
To configure the backend state, you need the following Azure storage
Playbooks
information which we created above:
Plug-ins
Postgres
resource_group_name: name of the resource group under which all
PR
resources will be created.
Prerequisites
storage_account_name: The name of the Azure Storage account. Prometheus
container_name: The name of the blob container. Puppet
key: The name of the state store file to be created. Puppet Agent on Ubuntu
Puppet Master
Create backend.tf file
Puppet Modules
We need to create a backend file.
Puppet7

terraform { Python
backend "azurerm" { QualityGate
resource_group_name = "tfstate" Red Hat
storage_account_name = "<storage_acct_name>" Red Hat Linux
container_name = "tfstate" Redhat
key = "terraform.tfstate"
RedHat Linux
}
remote state
}
S3
S3 Bucket
terraform init --reconfigure
SCM
Security
Shell Script
Slack
Slave
Slaves
type yes Sonarqube
Springboot
SQL
SSH
Teamcity
Terraform
Terraform import
terraform install
Terrraform
Tomcat
Tomcat8
Tomcat9
This should have created backend file called terraform.tfstate in a container inside azure storage. Troubleshooting
Ubuntu
Ubuntu 18.0.4
Ubuntu 20.0.4
Ubuntu 22.0.4
Ubuntu 24.0.4
Ubuntu18.0.4
Ubuntu22.0.4
Visual Studio Code
VSCode
VSTS
WebApp
Webhooks
windows
YAML
You can view remote state file info:

Report Abuse

Subscribe to my YouTube Channel!

YouTube 21K

Followers Clustrmaps
Followers (144) 14,225 Pageviews
Next Sep. 27th - Oct.
27th

This is how you can store terraform state information remotely in Azure storage.

Now let's make changes to main.tf to create more resources


edit main.tf
resource "azurerm_container_registry" "acr" {
name = "myacr563123"
resource_group_name = azurerm_resource_group.demo-rg.name
location = azurerm_resource_group.demo-rg.location
sku = "Standard"
admin_enabled = false
}

terraform plan

terraform apply --auto-approve


Follow
This will update terraform state file remotely in azure blob container.

Popular Posts

- March 03, 2022 Create Freestyle job in


Labels: Azure Blob storage, remote state, Terraform
Jenkins | How to create build
job in Jenkins to automate
Java build and deployment
of WAR into Tomcat
No comments: Jenkins is popular open
source Continuous integration tool. It was
written entirely in Java. Jenkins is a self-
Post a Comment contained automation server ...

Install Jenkins on Ubuntu


To leave a comment, click the button below to sign in with Google. 22.0.4 | Setup Jenkins on
AWS EC2 Ubuntu instance |
SIGN IN WITH GOOGLE How to setup Jenkins in
Ubuntu EC2 instance?
Jenkins is an open source
continuous integration/continuous delivery
and deployment (CI/CD) automation
Newer Post Home Older Post software DevOps tool written in the J...

Subscribe to: Post Comments (Atom) Create Amazon EKS cluster


by eksctl | How to create
EKS cluster in AWS cloud
using eksctl | Create EKS
DevOps Bootcamp Oct 2024 Schedule | DevOps & AWS Azure Cloud Coaching by Cluster in command line
Coach AK | DevOps and Cloud Computing Online Classes using IAM Role
What is Amazon EKS Amazon EKS is a fully
(Lot of new topics covered like GitHub Actions, Helm, Prometheus and Grafana..) The DevOps managed container orchestration service.
requirements in the IT market space is expected... EKS allows you to quickly deploy a
production ready Kubern...

How to setup SSH keys |


How to Setup Self Hosted Linux Agent in Azure DevOps | How to configure Self Hosted How to setup Repo in
Agent for Azure Pipelines | Create Build Agent in Azure Cloud GitHub and Setup Java
Let us learn how to create and configure a Self-Hosted Agent in Azure DevOps (ADO). Project in GitHub | How to
What is an Agent? An agent is computing infrastructure w... add a Java Web App in
GitHub using Maven
GitHub is one of the popular git-based
version control systems. GitHub is very
Create Amazon EKS cluster by eksctl | How to create EKS cluster in AWS cloud using good example for Software-as-a-service, ...
eksctl | Create EKS Cluster in command line using IAM Role
What is Amazon EKS Amazon EKS is a fully managed container orchestration service.
Deploy Springboot
EKS allows you to quickly deploy a production ready Kubern... Microservices App into
Amazon EKS Cluster using
Jenkins Pipeline and
DevOps Coaching Program Model Information | AWS Cloud Azure Cloud DevOps Coaching Program Kubectl CLI Plug-in |
Model Information Containerize Springboot App
(More New Topics..New CICD tool GitHub Actions, Helm included !! ) Here is the coaching model: Total and Deploy into EKS Cluster using Jenkins
10 weeks of coaching program 2 sess... Pipeline
We will learn how to automate springboot
microservices builds using Jenkins pipeline
and Deploy into AWS EKS Cluster with help
of Kubernetes...

How to Setup Self Hosted


Linux Agent in Azure
DevOps | How to configure
Self Hosted Agent for Azure
Pipelines | Create Build
Agent in Azure Cloud
Let us learn how to create and configure a
Self-Hosted Agent in Azure DevOps (ADO).
What is an Agent? An agent is computing
infrastructure w...

How to Integrate SonarQube


with Jenkins | Jenkins
SonarQube Integration
Here below are the steps for
integrating SonarQube with
Jenkins: Pre-requisites:
Make sure SonarQube is up and running
Make sure S...
Simple theme. Powered by Blogger.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy