How to Automate Deployment on Azure Cloud Using Terraform & Azure Pipeline | K21Academy

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
and in this video I'm going to talk about how to automate your deployment on Azure Cloud using or with the help of terraform using Azure Pipeline and as we always do I'll first walk you through what we're going to learn in this and then we'll actually do go and do it on Azure Cloud so let's first begin with what is the this lab scenario consists of so first of all this diagram here on right hand side represents my Azure environment and in that agile environment we are going to use terraform and the terraform will be using Azure pipeline which is azure cacd or devops tool as your pipeline that also acts as cicd that will use infrastructure as a code using terraform to deploy Azure web app what is this web app what is terraform what is azure pipeline I'll quickly briefly cover that and then once we have that infrastructure built which is web app then on the top of that we are going to use dotnet application now the same logic that you are seeing for the dotnet application same logic can be used or same thing can be used instead of dot net for Java python or any other application on Azure web app so this is the overall lab we are going to cover to be very detailed slightly lengthy but it will be totally worth your time now first let's understand the key concepts of your complete beginner what this key concept means so first and most important thing we're going to talk about cicd which is continuous integration and continuous delivery and if you take it forward in deployment I will explain one of the common difference between people have is what is difference between continuous delivery and continuous deployment so if you look at the whole development right from a developer development application and all the way till it's deployed and accessible to the user that whole process is called as a CI and CD continuous integration and then continuous delivery or deployment so one of the common question is hey what's the difference between continuous delivery and deployment so but before that what is CI continuous integration so you as a developer or someone as a developer will develop the application but before that application can be deployed that code must be collected and put it into a Deployable unit like it could be War file which is a web archive ER file which is the Enterprise type Java file which is a Java archive or it could be a maybe a image on to be deployed and container so the process of that in like bringing code from multiple developers bringing and putting into a Deployable unit that's continuous integration now delivery is where that piece of code is deployed on an infrastructure like maybe a web server or a in this case web app or a any other infrastructure but there is a testing or a human intervention required in order to test and deploy that in a production environment whereas continuous deployment is whatever you've done in delivery but automating the whole process where you there's no human intervention required so that's a process cicd so now in this particular case if there are multiple cicd tools like other gen cases there team cities there Circle CI is there bamboo is there AWS pipeline is there similar to that there's a Azure pipeline so Azure pipeline is a cicd tool that we're going to use in that Azure pipeline you need to understand the concept of agent and agent pool again so first is how to build and build your code and deploy your software using Azure pipeline so in order to build your own pipelines it needs some agent to run where which will collect the data or which go to the code um build the code and in a Deployable unit so the build is done using an agent and that agent will be a collection of multiple agents is an agent pool as a resource Group is a where all your different resources of azure which is like things like your compute your databases your web app storage networking everything under cloud is azure Resource Group now in that there is a app service which that we are going to deploy and app service is nothing but a HTTP based a web hosting tool so you might have done seen Apache or um is server in deployment of that in a uh in a platform Air Services the app service that we are going to use now this app service can be used you can deploy any kind of application depending on what when you're deploying the app service what you're deploying it can be a dotnet of base.net code Java Ruby when you're creating the app service you decide what underlying run template from you want which is a python PHP so in this case we are going to use dot net but if let's suppose you have a Java application you follow the same now if you want to read more about Azure app service you can go into this documentation here then there's a app service plan an app service plan is nothing but that is a collection or like when you define app service you need to find out or you need to Define how many CPUs you want what kind of a virtual machine you want under underlying where you want to deploy Etc all these things uh what kind of stories you need so all these things uh collection will be a service plan that app service when you're deploying this will use this service plan as well so this is in a nutshell Concepts conceptually then comes your final bit which is terraform and terraform is nothing but the infrastructure is a code tool which is used to automate the infrastructure build and what I mean by infrastructure is your virtual machine build for example or web app networking storage whatever you want to build on cloud or on-premise infrastructure that you can do using terraform in as well there's something similar called Azure web app sorry Azure you have a arm templates your bicep Azure bicep or in AWS are coming from AWS background you have AWS cloud formation so all those are parallel to terraforms we're going to use that so this is all basic concept if you want to go more about read further there's a related documentation which will be given in this which is infrastructure deployment terraform app service Azure pipeline Etc as well so this is in induction we have to cover to recap we are going to take a code from code repository the CI CD to my Azure cicd tool will be looking the file it will take that file or it will go to the code repository fetch terraform file as well as asp.net file using the terraform file it will first install terraform on the agent host and then create a my resource which is a resource Group web app or app service and then my then the cd part will go and deploy that particular.net application onto this web app which I've created and that's what we can access it so I've just covered you the lab scenario covered you very of this over with Concepts we will be um I've given you the documentation and before we actually go and do it which I'm going to cover in the next part there is a prequisite which you should already have I've already built that we have covered these prerequisites one one of the previous lessons so first thing is you should have it as your account paid account and if you don't have another account I'm going to show you um you can pick it from other place so this is I've already logged in and created portal.azure.com and if you don't have there should be a link on inside the portal for how to create this Azure portal account then you also have Azure devops account so I think you can go to dev.azio.com and you can use the same ID I think earlier used to be two separate IDs but using the same login window you can use sim Azure active directory behind the scene so if you don't have you can go and create login they already logged in here so one thing I've noticed is that it should only go to dev.azure.com it logs in back to Azure portal portal.azio.com which is azure portal and you can simply search devops and if you see here as your devops organization so this is the one which way I need to go so if I click on a zero the Box it's taking me onto the Azure devops cycle which is azure devops um here so you should already have that we should already have that covered somewhere in the past earlier this this particular thing now once you have done that that's when we'll go and actually cover the actual task which is uh we are going to configure a project on which we are going to do this whole CI CD then what we're going to do is then we are going to automate this infrastructure build in terraform using Azure pipeline in that I'm going to import let me show you first what I'm going to do here so I I'm logging into my um project or which I've already created a project and if you don't know that the prerequisite or pre um guide where you know how to create a project I'm going to use a demo generator using that which is azure devops demo generator I'll explain you in the next part what that means so we'll use this demo generator to bring all these artifacts like terraform and other projects already in devops pipeline once I've done that as a part of this demo we are automatically getting some files and you can use those files to deploy the terraform part and then the web app part once it's done I'm going to show you what happens behind this you know there's some things interesting thing the whole CI cd part I'm going to show you here so we will deploy we'll first do CI which means continuous integration which is this part which is here left hand part which is from code pipeline located asp.net artifact and terraform file and then we'll do CD which is actually this part which is here deployment apart or delivery part which is here and then finally we'll test the application accessibility and once we are done we'll clean up the resources if you hit any problem you should refer to this troubleshooting section which I've encountered which I'll cover that later so let's first go and create a configure the theme project and everything is inside those Azure devopsies inside a project and we are going to create a project but using a demo generator or a through something called as our Azure devops demo generator which will give you all the required artifact it's kind of a Kickstart it will bundle everything for you and you can then improve on top of that and once I show you I you'll understand what I mean by that if you've never done so you use this demo generator which Microsoft gives you the predefined cicd pipelines written for you so pick this URL demo generator here click here enter and you click on and say as your devops generator so sign in and start creating Azure devops so click on sign in first is I'm supposed to search a organization but it looks like the organization is missing so there's no drop down in organization which means in this account in this devops account I've never created a organization so another prequisite I should already have an organization so how do I go and create organization is I go to dev.seo.com and now in my Azure devops I need to this is because I'm first time it looks like this account has never been used so I'm logging in first time on this so first is our giveaway project name so I'll project name may be k21 Academy demo is the project name or maybe CI CD V8 CD the project name that we are doing now a project can have a Enterprise level visibility or public or private agent as name suggests I'm going to keep it public for now which means anyone can see this project and this is our if you want to know or notify about the devops other like basically tips and offers we'll just skip this and I'll just type this number here whatever is and click on continue here now it's going to go and build my organization it's okay um the specified name is reserved so I can't use that name organization name so I'll put it I'll change it and so this is nothing but my organization name which might be k21 Academy and if it's already been created we'll see that it'll if it's already there so this is already taken off so I'll say Ketone Academy 21 or or maybe say 23 so I'll say 2306. uh is the my organization name so project will be inside the organization and this project will hosted on UK South Region the project name is ACD it's public visibility and let's now go and create q p j Q click and hit enter and continue and it's taking me to this Azure devops animation and now I'm ready to create the a project okay I think I thought I created a project but let's create a project name again which is k21 Academy CI CD and create a project here so my ovulation is my organization is keep on Academy 2306 inside that I've created called catering Academy my cicdu this is the project which I've created now in that there's one more setting which is I need to enable parallelism and what that parallelism is let me see if I have a document this is when we are doing um create a free account uh this is one of the guide that we have already covered in past on creating and let's see free build pipeline parallelism this is a game we need to enable parallelism in order for me to go into the organization level secure setting I'll click on this organization here and then I if you see notice here on bottom right this is my organization settings so I'll click on this organization setting here now what you need to do is you have to come to this setting here called organization level settings and come under drop down there's a parallel jobs and if you see here that public project is zero parallel jobs and on self-hosted there's one parallel host on for for private projects as well so private project or again parallelism is a zero and for um self-hosted also this is only one parallelism so for both if you're creating a private project if the problem should be you can request 10 similarly for public project also maybe 10 and how to do it is I think we'll have a separate guide where we covered but again this is a Blog which you've written with how to resolve no hosted parallelism has been purchased or granted so there's a URL or there's a guide separate guide which you will be referred to enable parallelism so you simply go and go to this page which is AKA dot Ms um AZ pipelines Dash request go to this page and fill this form for parallelism again we should have a separate video and guide to refer that now what I'm going to do is in order to save time I'm going to log into another account which where parallelism is already enabled so we don't hit this because it will take maybe a day or two to enable parallelism so in for that I'm going to use a different account where parallelism is already enabled for you so make sure that you have panelism enabled in your account um before moving forward on this lab otherwise if you have not done that pause and stop here enable enable parallelism and come back to this guide again once that's been done so if you notice here I've logged in from a different account um now this time and if I click on organizational settings for this account and if I go under my parallelism once again this parallel jobs and if you notice here public project has 10 on and private project also on up to one parallel job for free TF and for public I have 10 so I think I'm going to create a project on public here now let's go and create on um this documentation let's go back to this Azure devops pipeline generator and I already have created a project again in one of the previous guides how to create a project should already be there or otherwise you can go back to here on Azure devops and you can create a project if by clicking on create a new project if you don't have I already have couple of projects created so um I've copied again going back to Azure demo generator and clicked on this demo generator and click on sign in again here it'll automatically log in and use my other ID I'm using my colleagues email ID here now here there are a couple of organizations we have created I'm going to use this k21 arm here and once it's done I need to give a name of the project give it a few minutes for this to come up so now um I'm going to select a template and template I'm going to use is for me um the the terraform specific which is under this devops Labs so I'll select the template for this demo generators using terraform there are other templates for that you want to do for tensible for Docker and so on currently for this particular lab we are going to terraform so we'll select this lab project here and then close here and once you've selected this click on this select template which is on this right hand side and you see the selected templates as terraform I think it might have gone again so select organization again if you see missing and then under project name whatever project name you say so in this case I'm saying terraform and CA slash or telephone cicd or something yeah whatever name you want to give it I'll keep it terraform cicd k21 whatever name and then from drop down you go and select these are other policies related to oauth we'll cover that as we go forward we'll see these and click on create project once it's there it's you'll see it here that your project is being created I'll pause it for a minute here and then once project is created I'm going to show you how does it look like inside the portal for you so if you notice here it says um the project has been um once if you say computations your project is successfully provisioned and navigate to project let's look at the parallel in the documentation as well I've selected the terraform select template I went into their choose template here and then you in depending on you might also ask it might also ask more extensions not enabled in you as a devops organization you select all of them and click on create budget because I've already selected that it is already picked up I've already created a project in past so that's why it's picked up only next is I'm going to I go and click on navigate project so I'm going to come here and say navigate to project or you can directly go into projects you should be able to see the same thing which we saw earlier under your Azure devops pipeline also Azure devops here so this is my organization inside that I have the project called k21 terraform cicd and that is where you will have all my other things like repositories this is where or any project that you see in Azure devops again we covered it at the first initially when we're doing the looking at the dashboard but again our console this is where my Azure boards are this is my repo which is my all my code files are this is where I have two parts which is a pipeline and that I have CI CD which is continuous integration and continuous delivery which releases delivery so now what happens is when you've exported or the we bought this project you automatically get all the files so first we are going to look examine some terraform of files uh on this so you go to Azure devops under a repo there should be files so that is what what we are going so probably let me open this let me move this on right hand side here I'm going to go to repo so uh this is my terraform repo and in in my report and that that is inside the project there's a terraform also in this drop down here from master and um they'll be under branches there'll be a terraform uh Branch so we'll go and look at the terraform Branch under this is the main Master branch and then we scroll down here you'll see the terraform Branch here and inside the terraform Branch uh then we're going to look at the contents files content and then we're specifically looking inside web app dot TF web app.tf so let's look at web app.tf web.tf so this is nothing but a terraform and if you're not familiar with the terraform I highly recommend you to start learning terraforms or terraform where we go and look at um I'll quickly explain you what this terraform look like I'm saying I'm looking for terraform version which is greater than or equal to 0.11 in that it's creating a storage account which has storage account which has a container and what happens is terraform when it builds it creates a state file which is all the configuration related to terraform inside that state file so we're going to key this key or where this terraform is under the styrofoam.state file this is for storing um we are creating a storage account in that we'll be having my state file of terraform now as a part of the script I'm creating Azure Resource Group or sorry as a resource a group which is like pull terraform is the name of the resource Group inside that I'm creating a service plan and so remember on when I was starting this um at the start I said we're going to create this uh Azure app service that app service will be leveraging as your service plan so that service plan will will tell me that what is the name of the service plan where is the location of that what is the resource Group name which is Resource Group which I've created earlier and then what is the uh this Azure app service plan will have a free tier of size F1 and then we are creating an app service so this my terraform is actually creating the infrastructure Services if you look at the diagram here now if you remember on here this is my terraform script which is going and creating these resources Resource Group and a app web app service here so let's go back down again so this is my terraform of file then there's one more um a setting is required so next is uh there's something called as part unlimited website this is the website which is a web.net application which we are doing so that is visible under SRC file so let's go under the SRC so if I go under SRC and there's a part unlimited website folder Parts Unlimited website folder inside that there is a file called CS project like is a part unlimited CS project part I mean unlimited CS project so this is a file which is part unlimited CS project there's one setting which we need to do which the setting we need to enable is that error on duplicate publish output file is false so if there's a duplicate publishing then um we are saying don't configure or don't share error this is nothing we encountered some of the issue in past and when we asked our developers so you don't need to do as a CI CD your developer should be able to tell these things for you so just this is one of the configurations we go and check here under this line after Target framework okay you need to edit it so click on this edit button here and then after edit you go and copy paste and say commit on here basically we are saving this let's see if there's anything else no commit and just say that term it so this is I need to move right hand side click on Commit and it's updated uh then further once this is done we are now building our build pipeline we see basically CI which we'll call build pipeline so we have got the file but we are going to go and build the pipelines we go under pipelines this is my pipelines and I have these are the there are two ways which are CI using a normal CI and then there's a second varies about EML file so let's go into Pipeline and we'll say we are picking this terraform CI Pipeline and then we look at the queue under queues here and then we'll say run my pipeline so the what it's doing is behind the scene it's already configured it's going to fetch the data from repo and build this pipeline here so select this data from CI and we'll say run pipeline so this is where you need to understand now it's using agent pool Azure pipeline that's already a pool was already created you should already have that now because we bought this project that already has defined all these settings for me which is azure Pipeline and now I have to do the Azure which I think Windows 2019 we leave it all the default settings here uh let's go back on to point here and simply say run here so simply say run here now behind the scene it's running this or this one queue one job is added into this uh one job is added here and I'm running this from my uh my colleagues so we click on this agent job run click on this it's telling you what exactly it's doing so it's basically uh running this and you can go through all these settings it's it's basically fetching the data and creating my Deployable artifacts which is my.net application and it's going to go and configure let's wait for this and see what happens so it's currently building those files and they will bring them our two things which is zip file which is part unlimited website dot zip that is where my.net application is and second is web app dot TF file which is my terraform of file so we'll I'll pause this recording here now and come back once these files are ready for me so it's been four or five minutes still doing these tasks so if you look at it's installed.net app executable and a lot of other things so it's still running it so I'll probably keep it running and 11 000 Lanes it's it's bringing it basically fetching the data and creating a.net Deployable artifact so if you see its build is now running so it's initially initialize the job check out the terraform these things install.net core restore the files and now it's building that executive or like zip file as well as the TF file as well so pause again here so I think it's around another five six minutes and I have this job completed now it's if you see all clean check mark if you come back onto the main screen here and I see now there's some warnings I think it's safe to ignore those warnings and it says one published one consumed I just click on this one publish one consume and see what output comes here so it's one published it has published output on red top folder and in that I have part unlimited website.z file that is my where my.net code is if I look at this documentation and then it also has given me the terraform file which is web app.tf so what we have done so far is if you look at in this diagram um on here so earlier I had a cop in GitHub or git repo or as your repo Azure pipeline has picked up this is and they've created a dot zip file and this terraform so this is my CI part which is continuous integration now I'm going to do continuous delivery in Azure terms it's called as release or delivery one the same thing as your or Microsoft Azure they say release which is going to pick up and then create this terraform file from here so let's go back onto this documentation one more time continue frame we are now done CI let's continue with CD which is part which is my release so this time I'm going to go to Pipeline and click on release apart now wherever you're watching this there should be this guide which you can refer and anything that changes will keep updating in this guide so click on Pipeline uh sorry um pipelines under pipeline this is my CI which is Pipeline and this is my release is my CD so this is my CI and this is CD so click on release and we don't have any release so we probably might be creating a new release all pipelines terraform CD this is what we needed to do under pipelines terraform CD under releases so this is my terraform CD that we have just now received platform CB now once I click on that I should be getting a new release of this terraform CD so click create a release I've already selected CD and then click on edit here so stereo from CD and click on this edit button I already have that delivery already built by that tool so what it's saying is that terraform CI from here it's going to deploy it on a development so let's see what that is doing um so click on one job a task will will click on this job and see what happens with one job with there's a one job of deployment or delivery in that within a job there are eight tasks so we'll just click on and see what it's doing so within this delivery on this job the one first task is azure CLI to deploy resources what's happening is and these are some steps within that delivery so first step is I'm creating a CLI also using CLI to deploy the Azure required resources and what these because resources are I'll explain that as well in a minute so first and most important is I need this is my devops which needs to go to my Azure cloud account and if um so if I look at in this particular documentation if I go back now it's always good to explain by the pictures so my Azure pipeline Azure devops it's going and creating or connecting onto this Azure Cloud here so that means it needs a connection here so and that is what connection we are giving so let me go back continue here yeah so from this drop down I have as your subscriptions I already did a connection in past otherwise what we'll do is you will create Azure subscription and it will create a connection for you I already created Azure service account connection so you if you go and use this collection here for me or I think that's been gone so let me create one more time because I did it for the previous lab earlier so I'll say this is my subscription and I'll need to select and say authorize this will create a connection and and my Azure devops will use that connection to connect to this Azure cloud account this is my service connection this is a connection it's going to use that to connect now script is within in line and what it's doing is let's explain this is very important first of all so it's creating as your group create it's created a easy Group which is azure Resource Group inside that location and it's creating a storage account so basically what it's doing is storage account in that storage account it's creating a container and in that container it's using my terraform key so it's basically my state will be stored here so that's one once it's created the storage then it's good to go and create a storage key so again let me go back to the parallel documentation just in case if I have not missed anything so this is just authorize and I'll just authorized here next is I'm going to go to the Powershell command here so this is using Powershell same connection type I'm going to use Azure resource manager collection type and my subscription is uh the connection that I've created earlier just now so which is my Azure service connection here and what is the game getting is it's retrieving the key and keeping that key storage key that we are going to use for my telephone account so that's also check mark correct this is all fine and now we are saying replace token file let's see if there's anything on replace it's worth looking at this documentation for you so there's nothing on from a point which is my replace token number three there's not much then this is already selected then it's saying install terraform here 1.3 now terraform in it this is where I need to update something which is some settings need attention so we'll look at what what services need attention terraform in it in it inside that first I need a subscription connection so this is if I go again here Azure subscription is the connection which I've done as your service connection endpoint and again first I'm able to do it becomes a little bit confusing but once you do understand what you're doing second time you repeat this lab it will become much more easier so inside that I need to give the container name name the container is terraform and the key is my terraform.tf state yes and I think C for this it's already saved and now it's checked terraform and it is correct now plan also so again terraform there are three stages one is in it plan and apply so in it is initialization which will validate the configuration plan is which will actually go and execute sorry it will see um that my configuration all the all the board everything is right and ready and it can be executed successfully and then an apply phase it's actually applying that so under plan I have to look at this parameter dash out is equal to TF plan so this is additional first I need to do the subscription again Which is my service connection which I've created earlier and additional command output which means about dash out is equal to TF plan dash out is equal to TF plan and it's all perfect and then finally apply Auto proof so if I go under apply Auto proof and what happens is when I'm configuring apply my telephone prompts and say hey do you want to prove this and you say yes so instead of that I'm Auto proving this this command here so Auto proof and then Auto approve Dash Auto proof TF plan so I'm going to change here and add TF plan and there I'm going to do that as your subscription as well which is my this drop down here network connection and now and the final thing is so once I've created infrastructure which is my Azure app um so as your web app this has deployed the web app now on top of that once it's done it's going to deploy the service or which are DOT net based service so that is where we need to provide some sort of settings again which is from this drop down which is azure app service connection here and let's see if there's any other parameter which I might have missed that's pretty much here so this task is actually if you notice this task which actually deploy the zip file that we have got it from CI into Azure app service um okay so once that's done I think we are pretty much done on this particular part and then we are going to save this as well and I think we need to put a comment I think they've already uh okay so comment and say um whatever comment you're going to give and say okay we've made these settings make sure that everything is Click marked correct here under agent and then we'll go on to oh I think I've already saved agent job so click on this agent job and we verify that what's happening with this agent job so it's Asian job it's using as your pipeline that is the agent pool and agent is running with on a Windows 2019 server on this so I don't think there's anything else I've already saved it and now I'm going to say create a release here so if I go back the save already saved and create a release so I'm good saying create a new release um terraform CD and check marks Dev box here so what we're doing here is like um from the stages for a trigger chain so on how should this uh release should be triggered and it can be automated or manual we are doing it a manual we are saying from this drop down we selected devil moment Dev sorry this select manual and let's see if there's any setting I need to do here I think that's pretty much I give a version telephone version whatever is version available terraform from this drop down here so what is available here and then simply you if you want to give a description give a description and click on create button here so click on create and now one a release has been created what we're going to do is we're going to review on we'll go back to the terraform CD release one blade so if you go back on to the my terraform CD all pipelines terraform CD at least this is my One release one which is which we have just now created so click on release one be a memory trigger this one we click on this Adobe here and then we are now ready to deploy this one so this is what we are saying deploy and click on deploy button here and you add a comment and click on deploy so now this is one job that has been cured if you see now as your pipeline which is this is now I'm doing CD and it's been Queen uh queued for any execution if you want to see the log and you can see what exactly this deployment part is doing we can go back to otherwise pipeline you can click on and saying the eight task this is exactly currently working on first task which is under log it's saying what is list doing it has already done something which is initialized job that has been done second part is downloading artifacts and you can then keep looking at all things what's happening behind the scenes pretty intelligent and then you could go and look at very very detailed information right here so second task is download now it's saying as you'll see I like to deploy required resources it's deploying some resources and it's Cloud it's logging to the cloud and it's doing some task which is using this account so keep monitoring and I would highly recommend you to go through understand one anything fails will come to know here when I did it if you see now it's creating an account storage account so we can go and look at terraform storage some name so it's creating a storage account I can go now on to the Azure portal so it's portal.azure.com under West us it's creating a storage account so we'll go and look into the storage account let's see so it has created a storage account let me pick out the name of the storage account which was something to do with terraform so I'll you simply go and verify the storage accounts and it has created under terraform RG Resource Group it has created a resource code for terraform RG inside that it has created a resource called terraform SG storage account this storage account and inside that there should be container so let's see storage container and that container will have the containers that I think there should be contained called terraform if I'm not wrong so yeah it has created a terraform container and inside that there's a terraform.tf state which will be uh used so we have done successfully here and let's see what it's doing so close this and let's see what task it is so it has it has done my CLI it says in Powershell it's a replace token terraform it's installed terraform in it now it's doing the plan which is whole plan which is doing so at any point in time you it fails you know where exactly it's whatever is doing now it's on auto proof task of this job so let's go into this Resource Group what it has done it has created a resource Group everything is under a resource Group or terraform something so let's go back to Resource Group here and which is terraform RG Resource Group that is the one which is created inside the resource Group it has created a storage account for now we should have a web app as well if it's successfully created so it's doing something I'll pause in the middle as well it's trying to pull terraform plan uh from this file yeah so pause somewhere in the middle if I close this what it's doing is if it's saying it's basically it's deploying a web app right now as your app Services deploying app service right now onto the portal uh so adding files it's pulling a lot of things so my terraform in it you want to see that's being done it has used a terraform running from a Windows uh host agent host and now it's doing app service and once it's completed successfully deployed the package to the app service so if I go the it has created a app service I was hoping to see it under app service so let's see under that service it might be quitting on a different yeah so it is created inside a different pull terraform plan okay so it has created a app service plan this which we saw I want to see in which resource Group it is created but so if I click on web app create so it's created it has created a and this is my default domain this is name these are all under Resource Group called pull terraform or pul Terra formula if we go into the command uh terraform script you will see that it's under this Resource Group let's go back to the CD and it's saying job successfully completed here right now and then once it's done I probably once it's successfully completed we go back to my under app Service uh you should have this app service already running now here and it will be with this name pull terraform web click on this and you can go through all the details about app service if you want to go further deep onto this but how do you access there will be a default domain here just click on this it will open my website or whatever is app deployed on this and if you see now wow this is my Park unlimited website that we've just deployed using CI CD and that's pretty much all in this particular thing but before you go there are a couple of other things you need to do I'll wrap it up we'll explain you what it means and everything but before you go ensure you clean up the resources otherwise it'll eat up your resources on Microsoft as your will how to do that will explain but before that uh go and update in LinkedIn profile the reason why we ask you we complete this package whatever you've learned make your watch this video One More Time make your notes in terms of what all you've learned to different Services Etc as much as you can maybe bullet points 10 15 points and say in this lab you have successfully created this take a screenshot of this particular maybe a website as well as this as your um this particular screenshot maybe another one this one and maybe uh one doing cacd part as well couple of screenshots Post in Long LinkedIn the reason why we ask you to recommend you to do it in LinkedIn is that it will inform all the potential employers or recruiters as well as if you tag as Capron Academy we will amplify that your about your reach on that will give a good impression that you're working on those second is um in our WhatsApp group make sure that you inform others saying that you have done this lab that way it will inspire us to do more of these labs and we'll also Inspire others to take action they will also start doing these labs and that's how we learn together so do these tasks and once that's done go and remove these two resource groups that we have created so there are two resource groups one is which we saw so Group which is pulled terraform terraform and you can simply go and delete this Resource Group when you delete this Resource Group all the resources within under this will will go away so I'm going to quickly delete by clicking it here so I'm coming here are the first what is so screw was pull terraform delete Resource Group and you will type that command again or other resource Group name anything that you delete it are prompt you to delete or confirm that deletion again which is Resource Group name which in my case is pull terraform plan no the resource Group name was p u l t e double r a f o r n this pull terraform and click on delete here and say delete resource here so delete it and like that I'll go with other resource Group which is full terraform RG and click on delete Resource Group and say type here click on delete say click confirm delete that will clean up are these my resource groups now if you hit any problem we'll also you can delete this from a cloud shell as well um Power sorry the cloud cell using command line or the GUI is one of the same thing that you can do either of them now if you hit any problem that should be covered in a troubleshooting section when I was doing first time earlier it failed and it failed on one of the scripts on this particular form when I was doing terraform in it and why it failed was if you look at the error message and let me make it looks like it bigger this and that probably will understand so first of all it failed a terraform in its state and what it failed what error message was that status code 404 and it's unable to find storage service account workspace which was it's trying to create a workspace a container and it's in container not found and the reason why why the container was that it takes some time for my if you notice here on the first come um stage here it creates a CLI and it it basically creates a storage account inside that creates a container and that container is used to host my it file and that container was not created take some time so maybe if you hit a problem like this make sure that store it's about storage account which is container not found and if that is the case then you can go and check the storage account is created or not the way I showed you earlier if not go and create or you can manually yourself also go and create it or wait for uh this to finish sometime it can happen that it might fail and if you wait and you read on the script it will it should work so that's pretty much in this particular lab I'll do a quick recap on what we have learned so what we covered with this lab was that we created a automatic and infrastructure on deployment using Azure cloud or sorry automating the infrastructure deployment on Azure cloud with terraform using Azure Pipeline and this was the lab which we did we had a code which was which Azure pipeline picked from Azure repo created as a part of CI got dot net as well as terraform.tf file and then cd part picked up that um again Azure pipeline picked up that terraform created installed on the local who on this agent installed terraform software and then using the torraform it created a resource Group and inside that basically the web app and then second part which this release pipeline went and picked deployed that.net application and we were able to access now with that this is Atul from Team Ketone Academy thanks for watching this now go into it and then post it on LinkedIn as well as WhatsApp group and I can't wait to help you on another lab take care and bye for now
Info
Channel: K21Academy
Views: 6,686
Rating: undefined out of 5
Keywords: automate deployemnt on azure cloud, azure virtual machine terraform, azure cloud services extended support, deploy web application on azure, deploy app on azure, deploy application on azure, how to deploy application in azure cloud, azure devops automated deployment, terraform deployment using azure devops, configure azure virtual desktop, automation in azure devops, deploy azure web app using azure devops, how to deploy project in azure, how to deploy code on azure, K21academy
Id: ngWtd7oiwiM
Channel Id: undefined
Length: 45min 43sec (2743 seconds)
Published: Tue Jul 18 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.