Azure DevOps: Provision API Infrastructure using Terraform - Full Course
HTML-код
- Опубликовано: 10 июл 2024
- In this full course, we’ll automatically provision an API on Azure including the infrastructure required to run it, (by defining the infrastructure as code)! You’ll be shown how to do this completely step by step using: .NET Core 3.1, Docker, Docker Hub, Azure DevOps, Terraform and Azure.
When done, you’ll understand the power of Infrastructure as Code!
Level: Beginner / Intermediate
Code on GitHub: github.com/binarythistle/S03E...
My Book: www.apress.com/gp/book/978148...
Patreon Site (Exclusive Member Benefits!): / binarythistle
INTRODUCTION
- 1:57 Course Overview
- 5:23 What we'll build
- 8:22 Benefits of Infrastructure as Code
- 9:35 Tooling
API, DOCKER & GIT
- 10:55 Set up / Scaffold API
- 12:50 Remove Https Redirection
- 14:00 Dockerfile: Package with Docker
- 15:20 Build Docker Image
- 16:43 Run Docker Image
- 18:09 Push Docker Image to Docker Hub
- 19:10 Add .gitignore file to project
- 19:43 Initialise Local Git Repository
- 20:25 Create Github Repo and push local repo
TERRAFORM
- 22:01 Benefits Terraform
- 26:28 Write our first Infrastructure as Code (main.tf file)
- 32:29 Overview of Terraform commands (init, plan, apply & destroy)
- 33:31 Initialise Terraform Provider (terraform init)
- 34:00 View the Terraform Plan (terraform plan)
- 34:36 Security considerations Pt 1
- 36:30 Provision Resources (terraform apply)
- 39:00 Add a Container Resource to our main.tf file
- 41:55 Re-run terraform plan
- 42:30 Re-run terraform apply
- 43:25 Test terraform provsioned API
- 44:00 Security Considerations Pt 2 Service Principal
- 48:05 Create Service Principal on Azure
- 54:00 Add Service Principle Environment Variables for User
- 56:45 Test Service Principle Set up at Command Line
AZURE DEVOPS (Pt1)
- 58:36 Create Azure DevOps Project
- 59:35 Create Service Connections
- 1:02:45 Create our Azure DevOps Pipeline
- 1:08:00 Manually Trigger Pipeline (Deploy Docker Image)
- 1:10:10 Check Out Docker Image was deployed
- 1:11:42 Trigger Pipeline from Desktop
AZURE DEVOPS (Pt2)
- 1:15:21 Configure Pipeline to use Service Principal
- 1:18:33 Terraform State (terraform.tfstate)
- 1:21:29 Create Azure storage Account to persist terraform.tfstate
- 1:27:13 Update main.tf to use Azure Storage backend
- 1:29:06 Add Terraform to azure-pipelines.yml
- 1:37:25 Use terraform Destroy to remoeve all resources on Azure
- 1:39:18 Remove Docker Image from Docker Hub
- 1:40:20 CHECKPOINT: Clean slate before we run our Pipeline
- 1:40:43 Push all our code to GitHub to trigger build & provison stages
- 1:43:10 Provisioning Failure Investigation
- 1:45:10 Image Versioning Discussion
- 1:49:21 Idempotency and the need for versioning
- 1:51:50 Inject build verion in to main.tf
- 1:55:55 Re-run out pipeline
- 2:00:25 Test Our API
FINAL THOUGHTS & ACKNOWLEDGEMENTS
-2:01:22 Homework
-2:02:35 Patreon Supporter Credits
Hey Les, thank you SO MUCH for this tutorial!!!!
I implemented this for a job opportunity as a DevOps Engineer in order to get familiar with Terraform, and in my 2nd interview I straight up demoed a personal project of mine and with this pipeline/workflow and, literally the very next day I was sent an offer.. and I accepted!
I'm currently going through a couple more of your other videos and I absolutely LOVE how thorough but still straightforward you are with your explanations. Please, PLEASE, keep this channel going strong as I know it's helping hundreds/thousands of developers/engineers with improving their skillsets (and ultimately, their life in general)!!!
Many thanks again to you :)
I learned more from this video in 2 hours than from a week's worth of dredging through documentation and examples. You're great! Love the content!
Thanks Drew! Glad you found it useful!
This has to be the most beautiful devops/terraform walkthrough I have come across so far. Thank you.
Les, you are doing videos of every single thing I need to do with my projects. You're my hero!
Thanks a ton, my friend Les. I have done the tutorial with you all the way to the end. It's incredible, the way you have broken it down into smaller doable parts. Hats off.
Subbed! Les you should continue to produce tutorials. This by far is the best, if not one of the best, on automating infrastructure with terraform. I very much appreciate the CLI (ground up) to automated approach. This video is well structured and clear!!! Thanks 😊
There are tonnes of videos on this topic, but none explains so clearly as Les does, makes incredibly easier to understand and am now confident using Terraform and Azure DevOPS, many thanks for all yout time and effort, much appreciated Les
Thank you from the UK, really enjoyed the content of this video.
Really appreciate the amount of structure and thought that has gone into this Les. Also appreciate the accent as I'm welsh! Subbed
Loving the start haha!
Great video, very informative! 👌
Les, thank you so much for this video. I come from a primary infrastructure background and I am learning to automate Terraform with Azure Devops for our infrastructure environment. This really cut down the my learning curve by helping me know what to look for.
I have learnt so much by following the video step by step.
Thanks a lot Les....same to you stay safe wherever you are.
Amazing content on Devops and Azure. Thank you very much for taking time and helping the community.. subscribed :)
The entire architecture was explained with so much details. And I always love how Les takes extra care about security in the infrastructure.. Another good project. Keep it up Les :)
Thanks Bengali!
Many thanks and much much appreciation for all your efforts in sharing such knowledgeable sessions. Awesome.
This Service Principle set up was awesome! Loved it!
Really great, most helpful and love the 'from the ground up' approach.
Thank you so very much, I was so under confident when I got a similar kind of scenario from a friend.. but feeling confident that I can make infra on the fly with this tutorial's help
Fantastic follow along course... I literally went from beginner to Pro on Terraform in only 2 hours
Awesome training. Keep up the great work !
Thanks! This tutorial was awesome. Just what I was looking for!
Another Amazing Video on Terraform and full life cycle of Development PRocess Appreciate your efforts
Les you are awesome! Keep it up, Your channel should have a million subscribers!
Great content, trying to get started with DevOps/Terraform after hammering certs for a couple of years and this should definitely make it easier!
Thanks Les, awesome once again!
Thanks Les, really enjoyed the video. You explain things really well and easy to follow.
Thanks Gavin, that's what I'm aiming for! Cheers, Les
You are genius in a way explaining things step by step slowly - creating issues yourself and resolving it. If any issue happening in my project relating to azure pipeline , terraform and docker first thing I will do is watch this video ( Not the documentation portal) - sure will get the solution quickly.
The quality and scope of this are just amazing. Instasubbed.
I really learnt a whole lot and enjoyed this video....thumbs up.
Thanks Les!! really nice video. I’ve just arrived to your channel and I hope to continue learning from you!. More videos with this kind of topics (azure devops, terraform and so on) will be appreciated. For instance, something regarding logic apps and azure functions.
Like you said; step by step! Awesome tutorial, thank you Les.
You bet!
Thanks for sharing. I have used Terraform before but on AWS infrastructure. Now thanks to you, I should be able to do the same for Azure as well. Thanks again !!!
Glad I could help!
Thank you for such a powerful video, many details, and well done.
You're very welcome Pablo!
Fantastic video!
Very very well done! this is helping me a ton!! :)
Subscribed within the first 30 seconds of this video.
18 months on, and 'the computer still say NO' awards for you
Thanks a lot Jack. Amazing work!
Thanks so much for the course. I really enjoy them and learnt a lot.👍
Your contact is amazing!! Thank you so much!!
Excellent content!! Thanks a lot!
Awesome video. You made it so simple and clear.
Thanks Tazeem!
very good explanation covering various topics with such easy explanation, thank you.
Brilliant and Enjoyable!
I learned a lot from you, thanks so much!
Fantastic job! Thank you.
A MASSIVE help!!! Thank you so much :)
Very good video, excelent work! i learned too much, thanks!
you got my full attention and commitment in the very first minute. I will continue the Full Course now. Hopefully it will help me hunt the job i desire. great acting skills btw. cheers
Very nice. Thanks Les!
Thanks, for this amazing tutorial video!!
You're very welcome Hari!
i like the way you started the video
This channel is gold!
Thanks Sylvian!
aye!
A really cool lesson and example! I did everything step by step, plus I always tried to dig a little deeper. As usual, ideas came during the session. I spent 8 hours on the course. If there is a new version, it would be cool to add work with KeyVault
Many thanks for the great content you’re the best
Excellent, thank you
Gracias Les, eres muy didáctico en tu explicación y eso me ayuda mucho a mi, que tengo la intención (porque aun me falta) es consolidarme en el ámbito de Azure DevOps y Terraform.
Saludos desde la Ciudad de México
Thank you for another excellent step by step walkthrough. A few suggestions, presentation wise. Please use the a Light theme in your editor, and a slightly larger font because on smaller screens text is barely legible. Keep up the good work.
The demonstration was very good!! I want to use DevOps just with Terraform.. to deploy all Azure resources.. I will give a try
Thank you so much!
Great stuff !! Liked shared and subscribed
Thanks a ton Les! I hope this will be pretty much same with latest .NET 6,7,8 as well.
Cool stuffs!! I need to do my HW now!
I love you man!
Thank you this is great
Excellent tutorial
Thank you
Thanks Richard!
Thanks for this Les! You have similar mannerisms with 'sentdex'.
Wow, you are also an artist!
Thank you Les, as usual perfect content
Is the content in this 3+ years old video still relevant? Azure can change a lot in 3 years.
it's relevant in Terrafom with minor adjustments@@asian1nvasion
@@adhamelsharkawy_79thanks
Would love to see the solution to the "homework"!
Anyway, great tutorial, great teacher. The first, in fact, I would consider supportion on patreon! :)
I wish all my IT training was given by this Scotchman.
awesome, thanks to share your kwnledge with us
This looks great - it ties together a bunch of stuff I was trying to work through in separate courses.
When it comes to adding a .gitignore file, the new-ish dotnet command "dotnet new gitignore" is pretty useful - saves scrabbling through old git repos trying to find the perfect template file to copy in ;-)
Thanks Les! I have seen a lot of Videos to find out why we need Terraform. This course is the only one and by far the best one that thoroughly explain what it meant for.
Thanks a lot.
Hi Les,
thanks a bundle for such a great channel.
Regarding this tutorial, I am wondering how this is related to the previous version you have on your channel back to May 10th, 2019?
Nice! Who would have thought I would be learning IT from Father Ariandel himself? :)
love all your videos! any chance you planning to make how to deploy AKS cluster in Azure using terraform ?
Angel Les to the rescue again...you are awesome!!!!!!!!!
Thanks Oladejo!
Hey Les, amazing video! One suggestion - it'd be great to have the timestamps on the RUclips bar rather than only description. It's a simple change. RUclips will automatically pick it up from the description if you format it like...
00:00 Intro
1:57 Course Overview
5:23 What we'll build
You always need a 00:00 timestamp, min of 3 timestamps, and timestamps must be 10 seconds minimum
What is "the youtube bar"?
@@allthecommonsense ah my bad, I meant the timeline bar (just above the Play, Skip, Volume/Mute, etc. buttons)
based on a video's description, RUclips can automatically place timestamp markers on the bar
Hi Les, great video, really appreciate your effort, one thing not clear to me is how Terraform pulls the image from Docker hub, in the code there is no mention of Docker hub credentials?
Great Course !!! Thanks a lot. Did anybody have this problem in azure pipeline ?
Error refreshing state: state snapshot was created by Terraform v0.12.29, which is newer than current v0.12.28; upgrade to Terraform v0.12.29 or greater to work with this state
.
Run terreform can not be completed... Terreform version in my local machine is Terraform v0.12.29.
Hello,
thank you for this video, how can i create for example a multiple vms without destroying an existing ones the same storage account?
Les, so many thanks for the video. When I run "terraform destory" after finalizing main.tf as per "Use terraform Destroy to remoeve all resources on Azure" session, it destroys nothing and terraform comes back always with "
Regards to your acting skills (1:22) - yes you definitely do a great job - and accordingly, I see your videos on my 65" TV (Big Screen) :D LOL.. Jokes apart, awesome as always - keep it up!
Fantastic and great session, full of details easy to absorb and very interesting method to teach others. One thing I would like to know, I have already done similar things using out-of-the-box Azure devops server, what is the advantages/benefits of using terraform over the other tools?
Thank you very much for such a detailed explanation I was stuck with variable where to define and how to use in pipeline which I see now how, however I am stuck with one other thing right now that how to get the AppInSight InstrumentationKey my project fails with the error Key cannot be null if I run the project from Visual Studio it runs the container if I build it in command line line docker build or even docker compose up or build it fails and says some code need authentication I don't know what to do you seems to be the right person to ask the question I am stuck in it for a week + kindly help or advice if you have done a video on this topic Thanks a lot
Cool intro
hello Les, great video so far (half way through) and clear explanations. I am having a problem accessing my api (neither with ip or FQDN. It keeps spinning with no answer, would it change anything that my docker image has been built on a Mac M1?) once deployed on ACI and I cant find the reason why. Would you have an idea? Thanks in advance.
Your gift is still giving 🤗💛
I know you've got Patreon but I think you should also add a "Buy me a coffee (or beer)" link 👍
Re the homework, I can no longer run my api locally - anyone know the answer?
Great
If you are having problems with Azure jobs in your DevOps pipeline, you have to create a private project there (and probably change the visibility of your GH project as well). In the free tier, I only had jobs available in private projects.
Great video - When running your terraform at around 15 mins - which repository is the container image being pulled from? Local or DockerHub. Am trying to replicate your steps but fail on this. Have added in image_registry_credential to main.tf file but no joy.
Hi, can you please tell me what machine you are using for writing the code, win, mac or linux? The listener app, on my windows box errors on the line ($"./mainfiles/{provider.ToLower()}") and it indicates "directory name invalid....", when I replace it with ($"..\\..\\..\\mainfiles\\{provider.ToLower()}") it works fine thanks again for your efforts
What' if we have double subscription assigned and it fetches 2 hee visual studio?
Do you have perhaps a tutorial which will include API plus azure database? Thanks
Ya, may be the role of "King - Ecbert / Aelle/ Horik" in Vikings. Anyways choice is yours.
Between, yes your content and effort much appreciate !
For running docker is specific version of the windows is required ?, because i am using windows 10 Home and i am getting error message that "Docker server for linux however docker-compose target windows", and for changing it to windows it requires windows pro or windows enterprise.
Windows os license parameter in azure how to give it in terraform
Awesome, you are my master let me know if we can connect over other platform?