Transforming ARM into Azure Bicep

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign uh [Music] hi everybody thanks for joining our lunch and learn session today today i have mr l here with me and by the way i'm jackson felden the moderator for today uh today's session is all about azure biceps hopefully everybody will walk away with a good understanding of these azure technology uh yeah mr l if you want to give a quick intro about yourself and then i will share the code and we can get things uh moving forward sure thank you for introduction uh jackson it's uh lovely to be here and being guest in uh for the cloud lunch and learn uh presenting problem uh you know i presented before but this is a special topic which i have a you know more excitement to present today to everybody it's about azure bicycle which is a new language it's a new azure provisioning uh tool that we are going to discuss and we are going to try to discuss in a way that if you have professionals who already know azure arm templates which is prior way how you were supposed to do the azure native resource provisioning they would you know understand the differences where to use azure bicep and what are the benefits yeah and we'll have a bunch of demos that will go and about myself i'm honey yusuf i forgot that part always i do so i'm microsoft certified trainer for a couple of years there will be another slide about that how to connect with me but i'm looking forward to connect with each of you and you know let me know if you have any questions thank you okay great uh yeah guys before i start i just will give you one or two minutes for you to scan the code there is a small registration and then for us it's always good for us for microsoft who is our sponsor it's always good to to keep track of who is joining our sessions and please remember as well as coming the code or going through the to the link you can get some additional resources after the presentation just to keep your learning moving forward and yeah please do it now i will paste at the end of the presentation as well but if you could do it now we can have everything everything sorted okay yeah do that please just scan the code and there is a small registration just your name your email address very simple and then from there you can jump into getting some additional resources available from microsoft as well yeah uh when you are registering um at the end i will give you the the link as well anybody joining our session our live session will be able to get uh exam voucher as well i know probably you know at this stage say microsoft certification is very important for you for your company for yourself as a as a person as well and we are delighted microsoft is sponsoring some vouchers as well i will give the link at the end of the presentation as well please make sure you stay uh stay tuned that's awesome you know getting some free exam vouchers so and you know pumping your cv and getting more uh search that's definitely great you know opportunity yeah definitely yeah it's one less thing to be worried in paying paying the exam sure the less stress right you don't paid for exam so you'll be more relaxed yeah yeah okay i think now uh is ready to we are ready to go and let me just add your screen in here and then i would say yeah that's fine i can see your screen here already and okay guys that's pretty much it for for me for now i would say enjoy the session hopefully you will learn a lot i will be here on the background if you have any questions during the session please make sure you add your comments add your questions as well and then time by time we can have a small break and to tackle the questions otherwise at the end i believe we have a bit of time as well to just wrap up and make sure everything's fine okay thanks very much and stay tuned at the end of the up to the end of the presentation thank you jackson so let me take it from here again thank you everyone for joining to uh to clown the cloud and lunch and learn a session today we are as we already said we are going to speak about transforming uh arm json how we can uh transform these arm json templates into azure bicep and how we can just get started with azure bicep uh from the you know small steps up to the you know more complex deployments that you may want to do so before starting thank you cloud launch and learn for organizing this thank you our mentor thank you for the moderator jackson doing this and for everyone who is joining thank you everyone for you know giving your time i hope you will learn a number of things that going to be useful for you so that said let's move forward here so this is a little bit information about myself i'm not going to repeat myself i'll just point you to my uh latest uh to the latest if you want to get some latest information about azure bicep innovations what's going on with azure bicep team check out my blog post and as well as i will give you a link to the azure bicep team page where you can check there as well you know uh you see the twitter account you know follow me tweet about this i'll be happy to follow you as well and get connect with me on a linkedin profile uh that's it let's move forward and this is basically what you see is the infographic that describes the company profile t-rex solutions where i'm actually employed um this is a mid-sized company and we are very good place to grow your carrier and do interesting work and our company mainly specialized on serving government and federal civilian agencies with u.s census bureau being the largest and we did a number of mission critical uh deliveries there and we are very proud to have success in this project and that said you know feel free to reach out to me if you are on the market and uh you know if you have any questions or you want to join our team please you know let me know all right so this is the main part of uh our demonstration today so what we will cover in this session uh first of course we will start with what is azure bicep right without knowing that there is no point to move forward we need to make clear identification what it represents what type of language it is then once we know uh what it is then we'll look into the inner details why bicep language what type of new things you can do with that what are the benefits of learning azure bicep after that we'll have this how to get started with azure bicep what are the product productivity tools where you need to look we'll consider that one then we'll look into the azure bicep language concepts now within that azure bus language uh what type of uh how to make conditionals how to write your how to uh introduce your parameters how variables work what are the you know functions and stuff like that then finally of course we'll have a number of demos starting with the simple ones and then building on top of that based on azure git repo that i created for this um for learning the azure bicep and i will share that github repo so you can actually follow up and you know do all the demos which are there which you have like around eight to nine demos where you learn by doing which i believe always fun now what we all we are not going to cover is that that how to build ci cd pipeline with using like for example github actions i'm not going to cover that in this session but if you would like to look at some samples i will gladly you know point you to my azure repo where that work is already done so you can actually reference that while building your own ci cd pipeline for azure bicep deployments we are now going to look into third party support or integration related topics at this time next uh what is azure buy supplies so we come to the main part and as you see on the screen azure bicep is a new uh dsl language which stands for domain specific language for provisioning azure resources what it means it means that at the current moment the purpose of azure bicep is to make sure that it's easy it's clean it is fun to provision azure resources using the bicep language so that's the purpose so the and if that's what you are trying to do it's a perfect tool for that next uh as you may see uh the the purpose again of azure bicep is to simplify the altering experience with a cleaner syntax and more code reuse and we'll look into those concepts where this code reviews come very handy and this new language aims to make it easier to to write down infrastructure as code for developers and for devops engineers that typically create those things using arm templates and they do provision that in order to maintain their azure infrastructure so i'm just going to point out here that azure bicep is actually a transparent obstruction over arm and arm templates and we are going to look into that on a graphic that's going to come next and whenever you have azure bicep you can always transpile that you can basically convert that into arm templates and have this as a arm template json file output so let's look at that uh notion that what does it mean to have what does it mean that azure bicep is a transparent obstruction over arm and arm templates for those who don't know and probably most of you do know because uh this is probably not the first session you attended about azure deployments there is a layer called azure resource manager which does the authentication and as well as it's a set of api layer that stands between the client applications and the azure environment and here as you see the arm which is azure resource manager get basically it get calls from azure portal it can also work with some other azure sdk software development kits and what's the bicep language stands on top of arm templates meaning that whatever you can do in arm templates you can also do on this azure bicep language and azure bicep language again simplifies a structure and it's not using json uh json file related templates so what did you use then let's look at that so why bicep language right so uh so we say that it has a number of things that arm templates are also have but next thing i want to um kind of focus here is that why we need to switch using and learning azure bicep if you already know arm templates right that's the kind of very valid and good question to have so i hope the following 10 reasons that i'm going to display in few seconds on the screen here will convince you to go and at least consider azure bicep for your next azure deployment tasks and as you may see here on the right side we have a screenshot right it's from visual studio code and what you see here is basically in on the left side here i have a bicep code let me make sure it's actually done in a way that everything is yeah here it is so here on the left side we have a azure bicep code uh that shows the database provisioning for azure db it's it's a document in terms of namespaces and apis and on the right side we have the json arm template representation of that and when you compare that you see that in terms of if you ever did any programming in your life and you want to define no parameters and then define the resources then you will see that this looks more familiar like you would do the provisioning or writing on a kind of terraform type of tools or and what it is it means that we use the code concepts here not the json template um representation in order to put this in order to define our resource on the left but on the right side we are using the json representation which is more cumbersome and there's much more lines and much more uh space are taken out of it but then you can do it more concise on the left side using the azure bicep but that's not the only reason right to go forward this um as your bicep the first thing of course is is to understand and maintain your azure bicep infrastructure if you have more readable more cleaner and shorter representation of azure resource that's going to be just big vin vin for your day-to-day test and will save you a lot of a number of uh hours you know next uh is day zero support it stands for the fact that because azure bicep is using the uh specs uh it's using uh the azure biceps actually um as you already know it's using the um it's using the api specs of azure uh as a um as they are available online so that's why whenever there's a new feature of azure resource get updated or there are another new resource introduced into into the azure arm layer then you would be able to access them right away there would be no wait time in order to get that resource integrated to get that resource or update integrate to the azure bison zero wait time and next uh what we have is uh it's a transparent obstruction over arm and arm templates then it has awesome tooling in visual studio code and we are going to look into that uh bicep extension that adds a number of good features starting from the version 0.4.6 that i blogged about on my the cloud marathoner blog post so just have a look there but i'm also going to touch it and speak about them like linters validations they are really really good and they are just getting better from each release the next one next we have this clean code syntax that we mentioned uh code reuse built-in modularity right so on bicep language if you wanna use the modules there is already uh there is a possibility to do that and it's very easy to use you can have the modularity on azure arm templates as well right because there's a concept of linked templates that you can use and that's kind of alternative to the modules that you have on azure bicycle but they are different way you need to handle them in a bit different way that you would do with azure bicep modules then the uh azure bicep language has this deep integration with azure because of this day zero support and because of because of native support that azure provides pre-flight validations this is another great thing where you can make sure that before you want to push your scripts and to provision the resources based on your bicep language code you can ask the azure saying okay if i'm deploying this what would be the change how they would look like and i'm going to run multiple commands where we'll look into those pre-flight validation checks and how they look like and what's the benefit there yeah there are two questions i think it's a good time for for me to let's go ahead and just to let you know uh the first one is if bicep language is a native product of azure yes bias of language is developed by azure bicep team which is a native to azure correct okay that's okay that's sorted uh yeah the next one is uh does visual code support bicep yes visual studio code supports the bicep but visual studio code supports it it has extension so there's a support and i will show it yes okay and one more here if you don't mind uh let me just publish in here uh yeah why bicep over uh terraform yes so uh that's really good one in terraform you have to maintain the state you see there's the state management but that thing doesn't uh it's not needed for azure bicep that's like one difference another difference is that there's a day zero support phase azure bicep meaning that this terraform you would have to get updates in order to deal with in order to be able to use new features or get the bug fixes or stuff like that but with azure bicep you don't need to wait for that and plus uh another difference is that again this terraform yes you can provision your azure resource you can provision your cloud resources in not just azure but you can use for example other cloud providers but the purpose of azure bicep at the moment is to make sure that you can do the azure provisioning right easy and fun okay yeah great thanks for that great interaction from from the audience one more here let me see yeah does bicep offer change tracking like terraform so in bicep the change tracking thing you can do using the pre-flight validations before deploying your new templates it will tell you which resources are going to have updates which resources are going to be created so you can track it that way if that's the answer's new question okay great yeah okay no more questions at the moment yeah let's get moving all right let's let's let's keep the role uh uh moving here all right so as we said there's no state management and finally production support right that's very important if you are rolling something into production you want to make sure that if something goes unexpectedly wrong you can rely on um regular microsoft support which is actually provided by starting from the vice version 0.3 can get that you know official support from microsoft and that's the peace of mind right nobody wants to get stranded because of some bug or issue and being able to resolve on its own you know if you have official support that's always handy all right that's it let's move to the next one which is the you know uh installation and how i can run this azure bicep so basically depending where you run it and how you want to run it it's a cross-platform you can run it on a linux on mac os and of course on windows and you can use azure you uh you can use either your azure cli skills or your powershell skills with partial skills it's better to utilize your powershell powershell core which is cross-platform uh starting from the powershell version 7.1 but if you want like specificity i would just say that for azure cli you need to make sure that you have a version 2.20.0 or above in order to be able to use the bicep with that tool is powershell it needs to be a version 5.6 or above okay so keep that in mind and you'll get that information if you just you know search on it just be aware about that next is bicep language concepts i'm not going to spend too much time here i'll just list them as you see and as you see they are all regular kind of concepts that you have in most languages in most programming languages and as well as on the uh as well as on the script languages so one distinction i want to make sure is that everybody actually got it right azure bicep language is not intended to build applications okay you can't just go let's um build a web app using the azure bicycle language the main idea of azure bicycle language is a how you can define maintain and interac interact with your azure resources how you define them in the environment and you make it easy and you know kind of clean coat in order to interact and maintain that in long run okay let's make sure that everybody cuts it right as your bicep is not intended to create a web app or it's not intended to create a web application and run that web application but it is intended to define your web application as an azure resource and then being able to deploy and maintain that all right okay that said let's move forward here and instead of you know giving definition of each concept i want to rather kind of focus on the quick look into bicep concepts you know and those concepts that were listed but before doing that is there any questions jackson um if there is any uh please let me know uh yeah actually there is a another one yeah i know everybody using using azure is always conscious about prices and you know cost and and so on uh yeah the question here is do we need any separate license for bicep or this kind of you know part of the azure already that's awesome question actually thank you for question uh no you don't need any license to run the azure bicep it's actually open source project and it's maintained and it is maintained by azure bicep team on github so you are going to get the url at the end of session it's going to be qcr code no it is free to use um for any resource of course you deploy to your azure environment whenever those resources are running and active then whatever the regular pricing is you just pay for that that's it okay that but there is no extra price by using the bicep no no okay that's good all right sure great all right let's move here uh next is i say that we are going to consider these bicep concepts right and first of them is more important and one of the important is the parameterization right so when you use parameterization there are like different types of parameters you can introduce one of them of course is string and you can have this extra validations like in terms of defining the lengths or if you if you have any special expression you can define it then you can have this list of allowed values that you can introduce so that you know whenever whenever administrator or the person is provisioning the azure bicep language code they can you know pick one of the proper ones for example if you are speaking about the standard storage account in azure they can come with different redundancies and one of them is a local redundant service that's you see the first one and another one is like zone redundant uh storage right so that's kind of if you want to go visit but there is of course a premium and other ones and if you don't want to include them because there's higher costs and there is no business justification to use them then that's how you can kind of limit that next concept we have is template functions and variables so in terms of functions as you may see here we have a resource group function right and then we have another representation here on the top so the first one is actually this resource group function is available or if you even use your arm template arm templates they are going to be there so whichever functions you have in your arm template deployments going to be uh as good working on your bicep language as well and the one that you see here the string interpolation that that's basically to you if you want to define your naming of your properties or resources in a way that's it's more dynamic that's utilizing certain kind of environment name for example can be a good uh way that you can interpolate the names of your resources where you define your environment name or let's say azure region where that resource is getting deployed all right and that said of course the one of the biggest things that everybody needs to be aware while they're crafting their azure bicep uh code is the modules and when you look into the modules as you see here so the beauty of modules is that whenever you define it you can define of course within the module like resource groups and then if each resource group that you define needs to have multiple of azure resource included into that you can easily define the module but in addition to that the biggest thing here is that you can reference existing uh python files using the modules okay so for example in this what you see on the screen is that there's a visual machine that's actually referenced and here in parameters what we have here that like as you see we have three parameters here these are the three parameters that are required parameters in order to be able to provision this specific resource that's why you need to include them so that your uh azure bicycle language doesn't complain and there is no validation errors okay all right uh that said uh i'm going to move to the demos before moving to the demos uh is there any questions in the studio jackson the how things are going on on your end everything is fine i hope all right if there's nothing coming up it means everything is good i'm going to mute my camera just to make sure there's enough bandwidth for a good experience of the demos and i'm going to bring my visual studio code all right so here we go now i'm going to bring the visual studio code and i hope everybody is able to see that nicely and cleanly let's make it a little bit bigger here wherever possible i'm going to increase the fonts but this is basically what you see here uh is the visuals visual studio of course and i want to start with the extension that i told about it's a it's this extension when you click on when you click on the extensions button here you will see that and you go of course type the name bicep right we did that and you want to make sure that your bicep extensions is installed it has many features and that are making your that will make your azure bicep code coding very pleasant and you will use the validation that are built in there's intellisense there's a linting there are many other kind of life-saving i would say features that uh are really awesome and they will speed up your azure bicycle language understanding and coding okay so let's make sure that you always check this and make sure that it's installed so once this there next thing i want to show is that where you can find this right there will be a link so this is the my repo it's a public report where i have this uh you know code and everything there so you would see that there are samples here there's like eight um demos here in addition to that you have parameter files you have scripts how for example if you go to scripts you would see how you can use your azure cli in order to deploy each of those things so you can just i'm referencing this one so that you know where to look in addition to that if you wanted let's say to put some ci cd behind the scene uh using the github actions then you can look into this bicep test which i provisioned a couple months ago you can use this project in this project if you go to the actions you will see that it has actually github actions that are taking the you know code from it's basically taking the code as it is deployed as a bicep and then make a build and then provision that into the subscription where you give an access only the thing here i want to mention is that read this uh readme file because you need to make certain uh configurations in terms of you know which resource group which subscription you want to give an access and this is all done using the you know security recommendations of github okay so you need to set them up just be aware about that okay let me go back to the main bicep repository that's going to be the so this is the learn bicep so you can get it and you know make it work all right i'm switching back now to the azure to our visual studio code and the first demo that we are going to do let me show it again it's going to about storage account and parameterization all right then we'll jump into other demos so uh in terms of storage account if you remember uh i'm going to open a regular environment azure environment you know that you have and here for example let's look into these logs okay here as you see uh guys i have a storage account here okay and this storage account is a regular storage account nothing special only the thing i would like to show you is that here under automation you have this export template so this export template basically is going to take that storage account and show the json arm json template representation of it okay so i'm going to click on that and as you may see it's uh populating on the right side saying they are generating this really awesome feature that you know you can utilize on your day-to-day azure um uh as your day-to-day azure skills you can also download it or you can visualize that that's really good so it's taken a little bit longer than usual i never see that going so long here here we go so we have it here so if you go and basically know select all this schema and then bring it back to your azure uh into your visual studio code you will see that it's going to look something like that all right so this is uh your basically you know representation of all the resources within that storage account okay within that cloud shell account that i just show you and the purpose here is that what we see is it has variables right there's nothing defined it has resources under it which is the storage account resource and all the other related kind of storage account configuration here and we have a storage name here correct that's what we have so what i'm going to do now is i'm going to open another storage bicep and i'm going to compare them okay let's open this one and then this guy here okay all right all right so what we are going to do now let me remove this we are going to compare these two things okay so i'm going to make sure that our json representation is actually on the right side okay and then on the other side we have the visual studio we have the bicep language so as you may see here we have what we have parameter right we have resources and what we have on the left side is actually we also have the storage name parameter as you see we have a location which uh takes the current location of the resource group and it assumes that you know whenever you deploy the storage account it deploys under the resource group which is the usual case that you would do and then it has this representation which is different than what you have on um that you have on your storage account resource so if i put them side by side you will see that for example here there are a lot of similarities and one of the similarities that i want to kind of pinpoint for everyone is so let me so here as you see this is the basically you know uh resource type as you see it's a microsoft store storage account and same resource type actually exists on the right side here and then you have api versioning so these api versionings are also matching but it doesn't mean that it's going to match every time for example here when you provision using the azure autocomplete let's say you don't want to use the latest api version but you have to use the one that's prior to that so then for example here if you go back and press on uh on control tab you would set there are other versions you can use of this api let's say you know you can choose one prior version and if there is for example you type it let's say we made a typo here and we type here z for example training instead of that you would see it will give you these squiggly lines meaning that hey you know whatever you type we are not able to find it this is the awesome intellisense that uh visual studio code by spec extension makes sure that whenever you do something and you see these squiggly lines this is the warning making sure that something is not right but it doesn't prevent you from actually you know uh from not uh adding this so red one means that you know something is definitely wrong and it's not going to compile all right let's choose that one again we talked about location here in our case it's east u.s then you have tags okay so as you see tags are defined similarly they are all about a single quotes on the bicep part but you have to use double quotes on the anything that you do like string on the json arm template okay and that's pretty much it this is the most important part you need to know but let me do the following okay we didn't just come here to compare it let's make a first deployment and see how this intellisense can help us to provision a new resource using the visual studio code and to do that we are going to do the following we are going to use the snippets let me make it bigger here a little bit all right i hope it's much better and visible for everyone so for the snippets here i'm going to there's such a thing if you type rs you would say there's a drop line uh there's a nice drop down and you if you say rest storage this is the snippet that has been added recently where if i just click tab on it just click on it it will basically bring another storage account that where i just need to fill the names for example i would say it's a next storage let's give the name next storage and then we say okay this is going to use the not the prior one but it's going to use the latest api version which is the one on top and then here we have equals after we define the resource its type and api now we need to define its properties because the storage account there's a special uh restrictions how the storage name needs to be defined uh it needs to be all lower cases and digits up to 24 characters so let's say it's a cll session and we'll draw some numbers there to make sure it's unique then you see it's actually azure uh bicep language gives you the best um practices they are implementing best practice meaning that whenever you try to provision a single resource make sure that you are they are provisioned in the same resource group but this is a best practice it's not something that you are forced to do if you want for example uh to define that in a different uh region then you need just to define for example if you want that to be west u.s you are you can also do that one as well but again the best practice is to make sure that you have the resource group a function that takes the that takes the resource group wherever it's going to be deployed and location which is going to be the azure region okay then the kind is defined as storage v2 premium so if you don't want to have a premium another neat feature is that for certain resources they have this nice selection where you can choose the redundancy for your storage for example in our case we know that premium is going to be a bit expensive and we are going to use this for test dev purposes that's why standard local redundant storage is the cheapest and it's good for these purposes so you can choose that one and oops let me put the tab here and that's it so our resource is already defined here by you know a few clicks you're able to go and define if you want to add tags in the same manner you can go and if you for example control tab if you click on control and press on tap on your windows machine or whatever the mac or linux os requires then you will see that you have actually here some properties you can put that uh you can define some additional properties you can also define tags as you see here if you define the tags and we can do it here and we can say okay this is the let's say project name you can say project is and you can put the name here cll demo so this tag we just added so in terms of provisioning that right so it's good that we put this torch account it has actually two storage accounts with different names so how i would provision that right it's all so good but what's the way to provision so if you want to provision that i created this under the scripts nice set of uh scripts if you want if you never use that one this is the place where you need to start with the you know logging in into your azure environment uh you would just follow the steps and once you run everything successfully it would mean that if you go here and run this last one you should be able to see the name of your azure subscription in my case it's prime or mcdo azure that's why it's all good all right so because uh let me so because it's there the next thing that we are going to do is we will take this storage bicep right where we have uh we have two resource groups right uh we have sorry we have two storage accounts that we need to provision on a resource group in order to do that before doing that there's a neat feature on bicep extension that you can see here on top all right so this is called bicep visualizer so if you click on that you will see that it's actually visualized for us what type of resources are defined within this azure bicep language code so it says that hey you are going to get two storage accounts the storage account resource names are storage account and next storage that's what we see here correct so any questions till this point on the demo before we kick off the provisioning or we are good all right sounds like everything is fine so let's kick off the provisioning then right so in order to provision this again from the file here what you need to do we need first to create the resource group and then we need to deploy that and this is the basically example that we can use in our case we are going to say okay a z group which stands for az stands for accli and then we say create so as a location we can say it's going to be east u.s or it can be east us two or any other location that's close to you and the resource group name will say it's a resource group cloud launch and learn demo session okay and then we are going to press on enter so what's going to happen is that this command should create a new resource group called cll demo session in our azure and if you want to check that without leaving your terminal you can just type a z group and then you type list if you do this what you would get is actually a bunch of json representation which is not readable so let's make it more readable by adding output dash o stands for output and we type table here and voila what we have is much nicer look and we see that our resource group that we just wanted to create this provision here right it's ready for us so once this there and the validated next what we are going to do we are going to run the deployment for our storage bicep right so to run that we are going to type az deployment okay and then we'll type easy deployment group because that's the group deployment next we'll do subscription level deployment just to have it and then we want to create something right so we want to create a we want to deploy that storage bicep in order to deploy that we need to put the same resource group name that we created and that resource group name was what i hope that was the same but we can actually look into our we can go back to our azure this is the azure environment and i can see that the one that we just provisioned is actually this one resource group demonstration as you see it's empty there is no resource here correct so what we are going to do now we are going to say okay to that resource group that we just saw let's go oops let me do it again let's go and provision a resource from file dash f stands for file here and then we put the basically modules and then storage that's the name of the storage.bicep okay so what we did here let me make it a little bit bigger so i went first uh type this az deployment group create module storage bicep but before deploying this let me actually um before deploying this okay did we do it nope so before deploying this file we want to make sure that we can run some type of validation right modules storage okay so this module storage is the one we were looking into here as you see this is the file that has these two storage accounts right that's what it is and here what we are saying okay go and create that but before creation you want to run preflight validation there was a question about how we can compare if there are differences so let's do that so dash c here at the end actually defines that condition like check the uh preflight condition to see what will happen if you'll take this uh azure bicep storage uh if you take this azure bicep storage deployment file and run it what will happen so if you make it you know full screen here as you see the it says it's actually figuring out what's going to happen now it's a pre-flight validation and we get this back right so this is the way it's compared and say okay it says there will be two creations it's going to create this first storage account with the name that's displayed here and as you see it has a different api version than the one which is below that and they have both different storage accounts and then it's asking me here at the bottom you know do i want to proceed or not it will say two resources are going to be created do you want to proceed or not so i would say yes let's go ahead with that and now actual creation is actually kicked off and when this thing is running i'm going to switch to the azure resource here the same resource group and click on this refresh and when i click on refresh we don't see anything here but if i go to the deployments tab here you see that it says deploying so it's deploying and deployment name go as a storage here at the moment but this is still blue oh it says succeeded if i go back to overview and then i refresh this it will take some time sometimes it doesn't come up right away but here we go we see that two storage accounts have been you know deployed right as it's supposed to be happening and here we get the success message basically we get this json output saying that it succeeded all right so let me uh so this was a sample deployment on a resource group right where we had these two two storage accounts and we just went and deployed that now let's look at the scenario where you want to deploy more than one okay you want to deploy let's say module where you are going to utilize this storage uh with some type of parameterization so to do that we are going to dive into these samples and look into the uh this is the second one actual second demo where we are going to use the in the second demo we are going to use to deploy the azure web app and virtual machine at the same time so to do that uh what you need to do is go to that repo and click on this seven number seven uh deployment you see it's different it's starting targets go from subscriptions and what is the target scope is where you want to deploy these resources so as you may see there are four different scopes in our case for when you don't define it by default uh azure pi server would assume you are doing it on the resource group uh if you define it like subscription or any other then scope is going to change and as you may see here i define parameters we use the string interpolation here we made sure that our password are secure strings meaning there is no password checking into our repository and of course we defined a resource group is the name that's here and plus we have application service that's referencing this module from app services dot by spin modules correct so let's do that look at it quickly so under the modules here you have this app service and as you may see it's a application service that picks up the location of the resource group and then deploys the app service plan resource and then deploys the application on a free tier so that you know you don't get some extra charges due to demo all right this is what it is second you see that it's actually deploying another resource group and this time it's deploying the virtual machine and this virtual machine of course it has parameterized user name and other things but important thing is that if you want to find where it is you can actually click uh here's another if you uh put your finger on control you would see it will become as a link and you just click on it it will navigate you there which is really awesome in terms of navigations so you see that this file defines a virtual machine and all its resources network storage now everything that you need to have but the difference of this one is not just your azure bicep but it also comes with the parameters right and where are these parameters i went and created these parameters uh under param files folder here you see there's can i introduce you for a second yeah we are kind of nine minutes away there are five five questions here waiting for you do you want to tackle them now uh let's uh let's do the following let me kick off the deployment of this okay and then we'll tackle those questions and uh kind of sum it up okay all right so here we see a deployment again i'm going to click on this visualizer and the reason is that just to show you what's going to be deployed and you see that you know there's two resource groups uh it's a web app deployment and there's a my resource group that has a virtual machine and it's network deployment all right that's pretty cool let's do that let's do that happening and to do this again uh you can go to the demo scripts here and go to this deployment for the number seven it should be somewhere here here it is so so we are going to deploy this uh resources using this last one where you see that it's actually deploying to the deploying the those uh visual machine and web app and using these parameters right i define these parameters and if you look into those parameters you said i have some simple values here okay and this is for dev environment you can create another one depending on what type of environment you are deploying okay so let me kick off this script and then we'll go back to the questions so to kick this last script where we deploy multiple resource groups and i'm going to say okay run this first we'll try to have this pre-flight validation it's very important and let's see what would be the result it should go through fine and once we say yes okay all right so here we go it says everything is fine it's going to create 10 resources as you see here i'm going to just say yes deploy that so we can look at the result yes right while this thing is getting deployed let me kind of sum up that i had a also presentation about security resource and how deployed them and you can you know look into my azure repo how it was done what is the script how you can deploy your azure policies definitions and resource logs uh let me summarize that we looked here for what is azure before summarizing that let me actually answer the questions while this deployment is still going as you see and while this deployment is going let me just bring the resource groups here as you see i have 13 records now before it was 11 and here we have these two new resource groups they are getting deployed and if i click on one of them you will see that under deployment this thing is still rolling oh this is done if you looked at the other one this is also done oh cool so all deployment is done and what it means it means that once it is there you can go to your azure portal which is this guy here let me bring it just second yep here's the screen and this is your app service so in overview if you go there you can actually go into the again into the templates part and visualize that to see what's included into that it'll take a little bit of time here okay let it come up while it's loading this i will load the other one okay still in progress um i hope it wouldn't ask me to log in too much all right here it is so here if you visualize that you would see that we have here web app and we have the it's a web app and application service asp application service plan and for the other resource if you go there you said this is the going to be the resources that you need to deploy for the here here it goes uh all the components of a virtual machine when you deploy on azure including you know network interfaces your nsgs your disk uh and everything that's you know required for that all right okay uh that's it let me uh yeah we are following from the finish okay let me then finalize this so we covered all these things that i we just spoke about right we went what's azure bicep how to get started what you need to have in place and then we'll look into a number of demos in terms of you know getting our feet sweat with azure bicep language this is the basically codes if you want to scan them this is the learn bicep github repo that i was doing demonstrations from this is my linkedin account so you can get connected and i strongly recommend everybody let's get connected and let me know what tasks are you up to and then you know bicep project if you want to learn more about that this is the github repo for that and of course tutorials you can you know you know look at them here and this the questions and answers now go ahead jack okay yeah there we go and just to remind everybody in a few seconds i will paste the link where everybody can claim a voucher to do an azure exam or whatever the exam you want okay the first question is uh let me just present in here uh yeah does bicep offer custom scripting execution yes basically when you say custom script execution if you mean like can you bring json templates uh from arm and execute as a part of it yes there is actual provisioning for that you can do it but if you are talking about like some python script or some other stuff it's not there yet would it be there in the future i don't know but that's not part of the plan at the moment okay the next one is interesting enough because we know azure is such a a kind of you know large big platform does bicep support every azure resource available or are any exception does it support azure id components no because you have this uh actual scope to deploy into thin end that means that there is azure ad support and you can actually create your users you can manage your users using the azure bicep language so it's possible yes okay that's good yeah okay yeah the next one is uh interesting as well uh can we convert any arm pain plate to bicep file do we need any additional tool to do that no you don't need any additional tool and let me show you an example here i didn't come there the conversion that's a really great question actually thank you for reminding yes here if you look at the demo scripts uh one of the demo scripts is talking about decompile so let me come here here it is right so what it does basically let me make it bigger so yes in azure box you have this decompile where you just point into your arm template and it's going to make a best kind of you know automated conversion of your arm json template into by language code sometimes there are errors and squigglies things that you have to clean up on yourself but out of like 98 99 of the times when i used it it worked fine but there was a number of cleanups if you uh in terms of renaming the you know parameters making sure that everything links and when you have like multiple resources like virtual machines and networks and stuff like that you have to understand the configuration there so when you clean it up it doesn't you know you can do it in a nice way that it doesn't mess up the structure okay yes yes there is a way to do that and that's the example you can do it all right okay yeah the next one uh in terms of if arm template can be converted to bicep fires is there any recommendation or any precaution that we should be aware of no only the thing is that once you did that conversion go and try to deploy that using this pre-flight validation that i showed couple times that would be a good starter uh and plus you know look into the visualizer see that does all the resources actually exist in your bicep conversion that would be two things which i would look into okay the next one then is can we drag and drop the azure resources azure resources blocks and the code will be automatically built in the background yeah i don't know if there is such a feature yet i didn't see any but there is a such thing there are like different tools uh and they are mentioned uh they are not part of azure bicep they're like this uh farmer there's like different tools just let me know in the linkedin about that i will point you to that type of tools but they are uh commercial tools you have to pay for it but there yeah there's a drag and drop kind of ways how you can provision your azure resource yes there's such thing okay and then the last one at the moment yeah very important i would say as well uh how do we make sure bicep deployment is in compliance with azure policy yes that's a good question yeah good one yeah that's the reason why i uh say that there is actual demo about that right so to do that you need to define your compliance policies and deploy them before deploying your azure resource for example this deployment policy that i have here says that okay whenever you deploy any resource in your azure environment make sure that they are located in one of these four allowed locations so if they are in a different regions and these four don't let it happen so in order to make this happen and of course you can deny or audit that policy and rule of thumb is that first you you would want to audit that to make sure that whatever you introduce you know you don't break things right away okay and then you do the actual but first yes you can enforce that by making sure first you deploy your policies you need to wait at least like 30 minutes or so to make sure those policies take effect and then you know go ahead and deploy your let's say um violator let's say you want to deploy something in not in us but like in north europe right then that deployment is going to fail because that policies that definitions will prevent that from happening yes there's a way to do that okay and this is the example yeah yes the last question is in regards uh if we are giving away some exam vouchers yeah very good question um yeah i want to say before we kind of finish up for today uh thanks very much for the brilliant presentation uh yeah myself i'm walking away now with a much better understanding of this technology really powerful i would say and for everybody watching us uh let me just paste here the the feedback link if you could take you know i may not just to fill out a small evaluation for us you know it's always good for us to to see how much are learning if you are enjoying our you know our sessions as well and please take your time and do that for us and finally guys if you want to claim your exam voucher is always nice and very important i would say to keep your certification fully let's say fully updated uh yeah there go here is the link okay and thanks so much for microsoft our main sponsor to to be doing that for our attendees and yeah let me see a few more questions in here uh okay yeah there is one more technical question in here i believe uh yeah how it is different from azure blueprint yes so azure blueprints when you define them it's basically not just uh it has arm templates in it correct and with azure blueprints it's more like not just arm templates but you want to define azure policies and azure blueprints are something that you want to deploy on top of different subscriptions based on different environment to enforce certain policies and to make sure that certain resources are configured in a certain way so it's uh azure blueprints more of a much higher scope in terms of how to provision and run your uh different subscriptions in a compliant way correct so it's got a much more higher level of doing that so at this moment how you can use azure blueprints all those arm templates things that you have been including into your azure blueprints you can actually in order to maintain them you can generate them as azure bicep so that they are more compact more cleaner and more understandable and then you can generate your arm templates by using a z bicep build it's going to build you a json you know representation of your bicep and you just include them there that's how they are related okay one more question yeah that's really great our audience is is asking lots of questions yeah would bicep replace arm down in the line what's your kind of opinion if arm will be gone in a few years i would say what do you think i would say it's not going to replace completely against a uh it's a transparent obstructions the obstruction on top of azure arm and arm layer in azure environment correct so it's not arm templates are not going anywhere so if you have already in production things that you maintain keep them there uh it's not going to replace you look at the um azure bicep language more like a next evolution of arm templates to make it easy for newcomers new starters to start playing with azure resource provisioning and be much more happier and productive is that okay great uh yeah i think that's all for tonight busy night i would say yeah everybody must be a bit higher now with so much so much nice information of course the next step is always you know to keep following us and do some labs as well and try to do some real implementation that's always nice to in terms of learning yes thank you jackson for all these questions and everything again i will just remind for the everybody thank you for attending it was really pleasure please check my blog post where i'm actually blogging about azure bicep azure cli and new updates are coming in addition to that you know feel free to get connected with me these are the social accounts that i know where you can find me and reach out to me i would be happy to help with your challenge and see you know what type of next thing you are cooking in your backyard for azure you know deployments yeah okay that's great yeah okay thanks al for the great presentation one more time and thanks everyone for joining us this last hour i would say and please keep in touch keep checking our link linkedin page and our page for more session every wednesday okay six o'clock okay thanks very much stay safe thank you jason thank you jackson and thank you cloud lunch and learn see you guys okay great yeah great thank you
Info
Channel: Cloud Lunch and Learn
Views: 251
Rating: undefined out of 5
Keywords:
Id: T2-bm_gmLCI
Channel Id: undefined
Length: 69min 47sec (4187 seconds)
Published: Wed Sep 08 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.