Remote Backend State with Terraform and Azure Storage

preview_player
Показать описание

00:00 - Start
02:24 - Create the Storage Account
04:25 - Storage Account Key
05:26 - Create the Backend Block
07:34 - View Least Status
07:52 - Deploy the Resource

Links:
Zero to Hero with Azure Virtual Desktop

Hybrid Identity with Windows AD and Azure AD

Terraform Playlist

Code on GitHub

Blog

Рекомендации по теме
Комментарии
Автор

Instead of bootstrapping the storage with Azure CLI commands, any particular reason why don't you use Terraform to create those resources?

mloskot
Автор

Thank you, Travis. I'm recently learning Terraform and I could never get my head around remote states until now.

xGomo
Автор

In the beginning, you said that state file is created after terraform init, but it is created after terraform apply.
Great video, though! Love this playlist!

marcussantos
Автор

thanks for sharing your knowledge Travis!

zimek
Автор

how to run this through release pipeline? it asks for input yes/no which is not possible to provide through pipeline

indranilmondal
Автор

Very nice video and example Travis. If using terraform cloud could I store state in the cloud and the tfstate.backup in azure storage for better redundancy and DR scenario?

ncvman
Автор

Could you just run that initial script as a BASH script if you were using Github Actions for CI/CD? I'm still learning, and building a pipeline to AKS for practice, so this is a little new to me

PsyberMind
Автор

Hello Travis, Thanks for your videos and knowledge sharing. What happens if two terraform developers executed terraform apply/destroy concurrently working on the same terraform code base and have two different remote state files in different blob containers?

mkraochirumamilla
Автор

Okay i am able to do this but i want to have a backend with multiple subscriptions along with it cause i tried doing that and got an error saying that i have an undefined provider despite doing the correct syntax for multiple subscriptions according to forums

ArkaSkyburner
Автор

Does anyone know what the environment variable name should be on Linux? it is not ARM_ACCESS_KEY

valp
Автор

Hi Travis, i hv one query how can we call the same state file from storage account while deploying another resource for example: i hv created one resource group in my infra that is stored in tfstate file. now i wants to create one public ip in same resource group and i don't want to write code again to deploy resource group( we can't with same name as well) . Is there any option so we can call the same tfstate file from storage account.

anshuanand
Автор

what if that storage account goes down?

VGaming-msv
Автор

Happy new year Travis and ty for your knowledge transfer! I think state file is the "Achilles' heel" of TF, as in AWS you would need to setup dynamodb to lock the state file in S3. In Azure blob that is happening by default as you shoed in the demo. However, the worse part of the state file is if there were changes in the portal (not by TF) statefile is out of sync and that would cause different type of issues to get them in sync again. Where in ArmTemplate (BICEP) i could run complete mode and make sure everything is matched what is in the code. What-If is similar to TF Plan. Same would go for CloudFormation. Travis, what are you thoughts about it?

mosksky
Автор

Thank Travis. I've tried to add backend "azurerm" under required providers but I'm getting "Error: Variables not allowed" for all those 4 items - resource_group_name, storage_account_name, container_name, and key. Any idea? Appreciate it, thank you. 🙂

lichardbaliuag
Автор

I need that t-shirt! Where? Thanks for the vid!

jon-paulboyd