Using Terraform in Azure DevOps Pipelines PART 1

  Рет қаралды 43,122

skunklabz

skunklabz

Күн бұрын

This video shows you how to create a Terraform Azure DevOps pipeline that can be leveraged to create Azure Cloud resources. Watch PART 2 where I show you how to templatize this pipeline ( • Using Terraform in Azu... ).
Music by OctoberMusic: / octobermusic-1

Пікірлер: 114
@CantthinkOfAYoutubeName
@CantthinkOfAYoutubeName 3 жыл бұрын
Man this made my day, been looking for a 'from scratch' TF pipeline procedure and haven't been able to find one nearly as helpful till today. Thanks for doing this!!
@skunklabz
@skunklabz 3 жыл бұрын
I'm glad this helped guide you. Thanks for watching.
@nijamkullamkulla6133
@nijamkullamkulla6133 2 жыл бұрын
Hello, you are a savior for all the people looking for the automation of terraform in azure Devops. May god bless you ! Highly appreciated !
@skunklabz
@skunklabz 2 жыл бұрын
I really appreciate the feedback and do plan on continuing my videos on infrastructure as code as well as other DevOps topics. Please make sure to show appreciation by subscribing to the channel and liking the video.
@fpwilliams71
@fpwilliams71 2 жыл бұрын
I'd say this video is exceptional, on point, and clearly explains how to use Terraform in Azure DevOps Pipeline. Thank you very much, you've made my day and greatly appreciate you.
@skunklabz
@skunklabz 2 жыл бұрын
Thanks for the feedback it's much appreciated.
@fpwilliams71
@fpwilliams71 2 жыл бұрын
@@skunklabz Do you mind sharing the exact thing you did to fix the issue when the Apply task failed as a result of Service Principal not properly scoped. Please kindly share that experience.
@fpwilliams71
@fpwilliams71 2 жыл бұрын
I figured out how that issue was fixed. In my own case I used Azure Resource Manager > Service Principal (manual) authentication method when creating the Service Connections of the DevOps project. Obviousely the Service Principal Key was actually required using this approach. Thought I should share.
@skunklabz
@skunklabz 2 жыл бұрын
Thanks for sharing the solution.
@vikasg3729
@vikasg3729 2 жыл бұрын
No Nonsense explanations - straight to the actions with brief info. Too good video
@suvitsharma7432
@suvitsharma7432 2 жыл бұрын
All those who are having trouble regarding the access as contributor, *DO NOT* mention any resource group while creating service principal (inside service connection in Azure DevOps). It worked for me !
@wealthystudent
@wealthystudent 2 жыл бұрын
Thanks for providing great audio quality🎉 Nice work
@skunklabz
@skunklabz 2 жыл бұрын
Thanks for your feedback! It's very much appreciated. Please make sure to subscribe the channel to encourage more future content.
@ramanujamvs4763
@ramanujamvs4763 4 жыл бұрын
Excellent stuff . Nice that I had a chance to start my work with the 90% match
@skunklabz
@skunklabz 4 жыл бұрын
Thanks for watching and I appreciate the feedback.
@joejoe570
@joejoe570 3 жыл бұрын
what you mean 90% match?
@suvitsharma7432
@suvitsharma7432 2 жыл бұрын
Thank you ! this is exactly the video that I've been looking for :-) thank you
@terrygorham8739
@terrygorham8739 3 жыл бұрын
Great stuff...plus kudos for Cheech going blind mode!
@skunklabz
@skunklabz 3 жыл бұрын
Glad you liked the reference! :)
@kalyan769
@kalyan769 4 жыл бұрын
this was a really WOW, but please add the troubleshooting video also it would really help us in future . thanks alot for the video
@skunklabz
@skunklabz 4 жыл бұрын
Sure thing!
@say2merohit
@say2merohit 3 жыл бұрын
1 minute in the video start loving it ! great work watched and enjoyed the full video keep up the good work
@skunklabz
@skunklabz 3 жыл бұрын
Thank you so much! I appreciate the support.
@hariselvan7429
@hariselvan7429 2 жыл бұрын
Hello, This video is amazing and very helpful to me. Step by step instructions that you have given is very easy to understand. Thanks for posting this !!
@skunklabz
@skunklabz 2 жыл бұрын
Thank you for your feedback. Please make sure to subscribe and like to show your support.
@hariselvan7429
@hariselvan7429 2 жыл бұрын
Subscribed to your channel! Keep posting! Cheers !!
@InigoMontoyaGAMING
@InigoMontoyaGAMING 3 жыл бұрын
that's amazing, thank you so much, keep them coming
@skunklabz
@skunklabz 3 жыл бұрын
I know I've been lagging. I am working on my next videos. Soon to be released.
@honor7xuser999
@honor7xuser999 2 жыл бұрын
Best video and best explanation. Cheers.
@marsamuk
@marsamuk Жыл бұрын
Hi. Great video. Do you have resource recommendations where I can use to master Azure DevOps with terraform? Thanks
@nehasharon5491
@nehasharon5491 Жыл бұрын
Hey, I'm facing an error that says unexpected value environment, continueOnError and strategy. Any help would be appreciated!
@carodnful
@carodnful 2 жыл бұрын
Thank you! Very helpful to me too!
@skunklabz
@skunklabz 2 жыл бұрын
Glad it helped!
@rahulshaw308
@rahulshaw308 2 жыл бұрын
in your video using command you had created "skftcontainer" container but in terraform code you are using terraform.tfstate name of container why?
@shikha1911
@shikha1911 Жыл бұрын
Can we create the pipeline using terraform by using the existing service principal?
@lawrencejob
@lawrencejob 2 жыл бұрын
Thanks man this was so useful!
@skunklabz
@skunklabz 2 жыл бұрын
Glad it helped!
@TheMeehaw
@TheMeehaw 3 жыл бұрын
From one perspective it shows a lot, from other It does take a lot of assumptions. Why do we need all the things at the beginning? What they are for? Can we create them using terraform? ... Many questions
@skunklabz
@skunklabz 3 жыл бұрын
Those are all prerequisites to create the Terraform steps.
@RaviKumarAddala
@RaviKumarAddala 3 жыл бұрын
Great video. Very useful. Thank u so much.
@skunklabz
@skunklabz 3 жыл бұрын
Thank you for watching!
@pankaj7121
@pankaj7121 2 жыл бұрын
Great video, easy to understand. Thanks .
@skunklabz
@skunklabz 2 жыл бұрын
Thanks for stopping by and watching! If you haven't done so, please make sure to like and subscribe.
@shanehanson3339
@shanehanson3339 Жыл бұрын
this is perfect, thanks!!
@chetanvaidya5793
@chetanvaidya5793 2 жыл бұрын
Hi,, How did you resolve last error while deploying. I am still getting the same error after giving contributor role for myself to subscription
@skunklabz
@skunklabz 2 жыл бұрын
I believe I explained it in some other comment made here. But it had to do with granting the service principal the proper permissions.
@ramonvega7575
@ramonvega7575 2 жыл бұрын
So, if you use Git to store your Terraform code, when you push PR to Git, how can you have it automatically run init and plan and not apply until the PR is approved,
@skunklabz
@skunklabz 2 жыл бұрын
The pipeline would need to be modified to work on different triggers like on PR. This example I have here is just a high-level idea of what folks can do. How people implement is up to them. Everyone has different workflows and I can't cover all scenarios. Good point though.
@ChanceMinus
@ChanceMinus 3 жыл бұрын
Thank you. I appreciate you...
@skunklabz
@skunklabz 3 жыл бұрын
Thanks for stopping by!
@ChanceMinus
@ChanceMinus 3 жыл бұрын
@@skunklabz, I have been receiving a "Service returned an error. Status=403 Code="AuthorizationFailed" Any suggestions? Thank you in advance...
@skunklabz
@skunklabz 3 жыл бұрын
403 is forbidden but doesn't tell you much on what the underlying issue could be.
@abhishwetkumar
@abhishwetkumar 4 жыл бұрын
Thanks for the VDO , I was looking for this from last few days, its quite helpful. Here you used MS defined agent pool. if I want use a self hosted agentpool what extra steps do i need to do.
@skunklabz
@skunklabz 4 жыл бұрын
It should be the same but it must have all the prerequisites installed.
@philc8544
@philc8544 2 жыл бұрын
Great video
@skunklabz
@skunklabz 2 жыл бұрын
Thank you!
@chiranjeevik900
@chiranjeevik900 2 жыл бұрын
if i am using classic pipeline in azure DevOps, and i want to make some enhancements and value in my environment, then how can i leverage terraform for that?
@skunklabz
@skunklabz 2 жыл бұрын
You can use the same tasks in classic pipelines to get the same benefit.
@srujanmettu
@srujanmettu 2 жыл бұрын
Hi can you please help how we can use of parameters and inject the values while running the pipeline ? Instead of hard coding
@skunklabz
@skunklabz 2 жыл бұрын
That's covered in part 2 of this video. Go check it out.
@joejoe570
@joejoe570 3 жыл бұрын
Nice quick demo! for the 'backend' in .tf file there is this line: "resource_group_name = "tstate"" what does this line mean? We do not have such an rg named 'tstate' in subscription. Also there is no storage key provided either, so how could terraform access it? It works but cannot understand how. Also how did the azure-pipelines.yml found the terraform.tf? It checks for this file in root?
@skunklabz
@skunklabz 3 жыл бұрын
That would be the resource group name you are going to use.
@joejoe570
@joejoe570 3 жыл бұрын
@@skunklabz going to use for ?
@skunklabz
@skunklabz 3 жыл бұрын
All resources in Azures require them to be associated with a resource group. What I meant was you can use an existing resource group that has been previously created, or as in this case, create a new one.
@syedasif1004
@syedasif1004 2 жыл бұрын
Im still getting the authorization/authentication error during the stage:apply even after adding role assignment at subscription level.
@skunklabz
@skunklabz 2 жыл бұрын
Please check the comments here as there is someone that resolved the issue and posted what to do. It's been almost two years and don't remember what I did from the top of my head other than what I said in the video.
@nathamp88
@nathamp88 3 жыл бұрын
Thanks bro. Defo subscribing for more 👌
@skunklabz
@skunklabz 3 жыл бұрын
Thanks for watching!!
@khushbugupta5849
@khushbugupta5849 Жыл бұрын
Can anyone help me how did we make use of service principal did we used it in service connection? bcz in service connection we had mentioned "Azure resource manager" and then selected RG and before we had authenticate and we did even mentioned the "SP" in the terraform script. So why did we create SP in start
@skunklabz
@skunklabz Жыл бұрын
That's because you have to create a service principal first before even attempting to authenticate.
@suri4ulagumavarapu100
@suri4ulagumavarapu100 3 жыл бұрын
can you please provide YAML pipeline for CI/CD or githut location URL please ... i tried all the steps that in the above video
@skunklabz
@skunklabz 3 жыл бұрын
Sure: dev.azure.com/skunklabz/public/_git/terraform
@suri4ulagumavarapu100
@suri4ulagumavarapu100 3 жыл бұрын
Thanks a ton
@RameshP-ds4xt
@RameshP-ds4xt 3 жыл бұрын
Excellent !!!
@skunklabz
@skunklabz 3 жыл бұрын
Thank you for watching!
@UeberLandUndMeere
@UeberLandUndMeere 2 жыл бұрын
Hey, thank you. Do you have the code?
@dwiti7381
@dwiti7381 3 жыл бұрын
Thank you Sir
@skunklabz
@skunklabz 3 жыл бұрын
No problem.
@ParagDarji
@ParagDarji 3 жыл бұрын
Can you suggest a way to work with Terraform workspaces in devops?
@skunklabz
@skunklabz 3 жыл бұрын
That's a very good topic to bring up and something I'd like to cover in the future. Thank you for valuable feedback.
@ParagDarji
@ParagDarji 3 жыл бұрын
@@skunklabz Will you be able to project a timeline for that?
@skunklabz
@skunklabz 3 жыл бұрын
Not at the moment.
@ParagDarji
@ParagDarji 3 жыл бұрын
@@skunklabz Ok. thanks
@rohitpahuja1787
@rohitpahuja1787 3 жыл бұрын
if i am using classic pipeline in azure devops, and i want to make some enhancements and value in my environment,,then how can i leverage terraform for that? i am also yet to introduce containers, microservices in my environment and i work on ON-PREM environment.
@skunklabz
@skunklabz 3 жыл бұрын
Hi Rohit, I'm not too clear on what your ask is but Terraform can be run from either classic pipeline or pipeline as code. That's separate from Terraform itself.
@rohitpahuja1787
@rohitpahuja1787 3 жыл бұрын
@@skunklabz I see, you have any resources where i can learn how to use terraform from classic pipeline, and also i am trying to ask is that what benefits will i get by using terraform in my environment and currently there are no containers but i am planning to enhance it by introducing containers annd working on docker and kubernetes stuff and transition to devsecops too, so all i am tring to ask is, what value i can add through terraform in my environment? I hope it helps?
@skunklabz
@skunklabz 3 жыл бұрын
Hi Rohit. Terraform is primarily for managing resources in cloud using infrastructure as code. It's dependent on what cloud provider you're using and what resources you want to manage. Leveraging Terraform you can automate using pipelines with any CI tool not just Azure DevOps. In this video I just showed one particular example. There are many ways you can leverage Terraform.
@rohitpahuja1787
@rohitpahuja1787 3 жыл бұрын
@@skunklabz well right now i am not using any cloud environment, i have ON PREM environment, and we have azure devops servers which are connected to those ON PREM servers, so can i leverage terraform for introducing containers in my environment?
@skunklabz
@skunklabz 3 жыл бұрын
Unless you are hosting private cloud I'm not clear on how else you could leverage it for your needs. Containerization doesn't depend on something like Terraform.
@abdulthakur5608
@abdulthakur5608 4 жыл бұрын
how to give contributor role to my service principle at 16:35,, please advice
@skunklabz
@skunklabz 4 жыл бұрын
I followed this: docs.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal
@abdulthakur5608
@abdulthakur5608 4 жыл бұрын
@@skunklabz Thanks but my Service principle has contributor role, but it still does not work, please advice
@skunklabz
@skunklabz 4 жыл бұрын
@@abdulthakur5608 yeah that's what I did so not sure how to solve your issue. Sorry.
@atanudebnath9173
@atanudebnath9173 4 жыл бұрын
Please make more videos on azure DevOps
@skunklabz
@skunklabz 4 жыл бұрын
@@atanudebnath9173 they're coming!! ;)
Using Terraform in Azure DevOps Pipelines PART 2
7:32
skunklabz
Рет қаралды 11 М.
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 108 МЛН
REAL 3D brush can draw grass Life Hack #shorts #lifehacks
00:42
MrMaximus
Рет қаралды 10 МЛН
Smart Sigma Kid #funny #sigma
00:14
CRAZY GREAPA
Рет қаралды 7 МЛН
PowerShell Pester Tests, Key Vault and Azure DevOps
26:33
skunklabz
Рет қаралды 2,7 М.
EP12: Learn Azure DevOps Pipelines with Terraform Builds
38:25
Someone Elses Cloud
Рет қаралды 5 М.
Using Terraform with Azure
45:00
John Savill's Technical Training
Рет қаралды 118 М.
Azure DevOps Pipelines with Terraform and Stages
22:26
Travis Roberts
Рет қаралды 63 М.
Step by Step - Use Azure DevOps to Test, Build and Deploy an API
1:20:27
小蚂蚁会选到什么呢!#火影忍者 #佐助 #家庭
00:47
火影忍者一家
Рет қаралды 108 МЛН