Using Terraform in Azure DevOps Pipelines PART 1

Поділитися
Вставка
  • Опубліковано 5 вер 2024
  • 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 роки тому +9

    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 роки тому +1

      I'm glad this helped guide you. Thanks for watching.

  • @nijamkullamkulla6133
    @nijamkullamkulla6133 2 роки тому +3

    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.

  • @suvitsharma7432
    @suvitsharma7432 2 роки тому +1

    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 !

  • @vikasg3729
    @vikasg3729 2 роки тому

    No Nonsense explanations - straight to the actions with brief info. Too good video

  • @fpwilliams71
    @fpwilliams71 2 роки тому +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 роки тому +1

      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 роки тому +1

      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.

  • @wealthystudent
    @wealthystudent 2 роки тому +1

    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 роки тому +2

    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 роки тому +2

    Thank you ! this is exactly the video that I've been looking for :-) thank you

  • @GravitySucks2000
    @GravitySucks2000 2 роки тому +1

    one of the best demonstration... awesome man many many thanks...

    • @skunklabz
      @skunklabz  2 роки тому

      Thanks for stopping by, I appreciate the comments. Make sure to subscribe!

  • @kalyan769
    @kalyan769 4 роки тому +1

    this was a really WOW, but please add the troubleshooting video also it would really help us in future . thanks alot for the video

  • @terrygorham8739
    @terrygorham8739 3 роки тому +2

    Great stuff...plus kudos for Cheech going blind mode!

    • @skunklabz
      @skunklabz  3 роки тому

      Glad you liked the reference! :)

  • @honor7xuser999
    @honor7xuser999 Рік тому

    Best video and best explanation. Cheers.

  • @InigoMontoyaGAMING
    @InigoMontoyaGAMING 3 роки тому +1

    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.

  • @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 !!

  • @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.

  • @carodnful
    @carodnful 2 роки тому +1

    Thank you! Very helpful to me too!

  • @RaviKumarAddala
    @RaviKumarAddala 3 роки тому +1

    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!!

  • @lawrencejob
    @lawrencejob 2 роки тому +1

    Thanks man this was so useful!

  • @philc8544
    @philc8544 2 роки тому +1

    Great video

  • @abhishwetkumar
    @abhishwetkumar 4 роки тому +2

    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.

  • @ChanceMinus
    @ChanceMinus 3 роки тому +1

    Thank you. I appreciate you...

    • @skunklabz
      @skunklabz  3 роки тому +1

      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.

  • @nehasharon5491
    @nehasharon5491 Рік тому

    Hey, I'm facing an error that says unexpected value environment, continueOnError and strategy. Any help would be appreciated!

  • @nathamp88
    @nathamp88 3 роки тому +2

    Thanks bro. Defo subscribing for more 👌

    • @skunklabz
      @skunklabz  3 роки тому +1

      Thanks for watching!!

  • @shikha1911
    @shikha1911 Рік тому

    Can we create the pipeline using terraform by using the existing service principal?

  • @TheMeehaw
    @TheMeehaw 3 роки тому +1

    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.

  • @dwiti7381
    @dwiti7381 3 роки тому +1

    Thank you Sir

  • @marsamuk
    @marsamuk Рік тому

    Hi. Great video. Do you have resource recommendations where I can use to master Azure DevOps with terraform? Thanks

  • @RameshP-ds4xt
    @RameshP-ds4xt 3 роки тому +1

    Excellent !!!

    • @skunklabz
      @skunklabz  3 роки тому

      Thank you for watching!

  • @rahulshaw308
    @rahulshaw308 Рік тому

    in your video using command you had created "skftcontainer" container but in terraform code you are using terraform.tfstate name of container why?

  • @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.

  • @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  Рік тому +1

      That's because you have to create a service principal first before even attempting to authenticate.

  • @srujanmettu
    @srujanmettu 2 роки тому +1

    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.

  • @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.

  • @joejoe570
    @joejoe570 3 роки тому +1

    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 роки тому +1

      @@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.

  • @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.

  • @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.

  • @suri4ulagumavarapu100
    @suri4ulagumavarapu100 3 роки тому +1

    can you please provide YAML pipeline for CI/CD or githut location URL please ... i tried all the steps that in the above video

  • @ParagDarji
    @ParagDarji 3 роки тому +1

    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 роки тому +1

      @@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 роки тому +1

    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 роки тому +1

      @@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 роки тому +1

      Please make more videos on azure DevOps

    • @skunklabz
      @skunklabz  4 роки тому

      @@atanudebnath9173 they're coming!! ;)

  • @UeberLandUndMeere
    @UeberLandUndMeere 2 роки тому

    Hey, thank you. Do you have the code?