hello guys welcome back this is adam and this is eighth episode in azure fundamentals course in this episode we will cover the most basic things about resource management in azure so what are resources resource groups and resource manager stay tuned one of the most important things you need to learn when working with azure are the core building blocks for management of azure services and those building blocks consist of resources resource groups and resource manager but we will also cover what are the benefits of using those core components when building solutions in azure so let me
start with resources when users go to azure they purchase services services like sql database maybe web application hosting or simply a virtual machine but it doesn't matter which service they buy in the end all those services are represented as a generic object called resource you can think of resources like an objects that are used to represent your services in azure they're basically your contracts representing also a service lifecycle so as soon as you purchase a service in azure you create a resource as soon as you're done with the service and you delete it the resource
is also deleted azure uses resources to save all the configurations that you make for your service pretty much any configuration option that you have for your service is represented as a property on that resource all the resources in azure can be represented as a json template json stands for javascript object notation and it's a simple file that has properties and values it's one of the very commonly used standards on the market describe pretty much any object today we don't need to deep dive into specifics of this json format but you should at least know that
there are four common properties across all resources like type api version name and location and some other non-common properties that are different and used to describe different resources different services within azure but no resource in azure can be created without something called resource group a resource group is a logical container for only resources and it is requirement in order to create any resource in azure so for you a resource group is a grouping of resources but you should use it to logically group related resources it is not a hard requirement but research groups were created
as a utility to manage other resources therefore you should take advantage of them so how do you know how to group resources together in research groups well there are many strategies to do so for instance there could be a strategy that you would want to apply where you group your related resources by type in that case you could have resource groups for your sql databases and separate resource groups for your web applications more commonly used strategy is grouping resources by application lifecycle so having your development resource groups spread from your production resource group so that
you can apply different scripts different policies different security rules and different access management policies you can also organize by department name or use resource groups to group resources for billing purposes for instance creating a separate resource group for each cost center within your organization you can also create resource groups by location which is azure region so that way it's easier for you to manage data sovereignty and security compliance requirements for your organization but there is no silver bullet here there's no one policy that will organize resources for every organization on the planet as such pretty
much any organization uses a mix a combination of those strategies like combining application names with environment names to give a full separation of the application development life cycle with their production life cycle but also total separation across multiple applications this is probably one of the most commonly used strategy on the market let me now move to azure portal so i can create few resources and resource group myself as i've mentioned previously you always need a resource group to work with resources in azure so let's go and create a resource group first go to the menu
on the left hand side select resource groups and click on the add button once you do it a form to create a new azure resource group will appear where the first property that you need to select is a subscription which simply said it's a billing unit for your entire azure account in my case it's a visual studio subscription you also need to provide the resource group name i will call mine az 900 so this will be the resource group that i will use for remainder of this course and a region so where is the metadata
about the resource group contained so this is not relevant to the resources itself you can have resources in different regions so i will select north europe hit review and create and before anything in azure is created you always are shown a validation screen think of this like a receipt it will summarize all the properties and all the options that you selected for a particular resource in this case a resource group and if you are sure you want to create a service simply hit create creation of the resource group is instantaneous and resource groups are free
so you can create as many as you need without worrying about charges once created you can navigate to the resource group to review the contents of it right now we don't have any resources to display because we didn't create any resource yet you can either hit add here to go to the marketplace and create resources or again use the menu on the left hand side for instance by going to storage accounts storage account is a service used to store files in azure to create one simply hit add and as you see there is a form
that you need to fill in and always the mandatory field is subscription and resource group within that subscription once you select the resource group you need to fill in some of the common properties like for instance storage account name i will combine am demo storage 123a the validation pass so this name is currently free and everything else i can leave as default if i will go review and create again a receipt will be shown on the screen showing me every property that will be used to create my service this is important if you're using default
property values if i'm sure i can simply hit create and that's it this is how easily you can create resources in azure once the resource has been created you can simply click on go to the resource to go directly to azure service and start managing this or you can navigate back to resource group to review but this is currently with a new resource group so resource group is a logical container allowing you to manage the resources within it additionally there is a access control panel here as one of the purpose of resource groups is access
control in this panel you can add permissions for colleagues so you can manage permissions for your resources making sure that your development team has the proper privileges to manage all the resources and you'd simply do it by hitting add role assignment selecting the role which is simply set a grouping of privileges for managing other resources so you can find grain permissions for your development teams for instance selecting an owner means everyone can do anything and then selecting one of the many accounts in your tenant so you can very easily grant new privileges for instance tomdo
when i select him when i click save i will be able to find tom in role assignments tom is now an owner just like me so he can do anything with this resource group and all the resources within it additionally anything you do in azure portal you can also do from command line for instance this is azure cli which is a simple command line utility for azure you can write azlogin log into azure which will open the browser window asking you to log in once you do it you can go back to your cli and
now start working with azure in the same manner and managing our resource and resource group from cli is as easy as in portal if i type a z group create dash dash name az 902 location north europe this will create another resource group with name called az900-2 if i type ac group storage account create dash name am demo storage 123b resource group since we need to put that resource inside of the resource group in this case it'll be az900-2 and location again north europe once done a service will be created but in this case using
a command line and once this process completes you can navigate to resource group and your newly created az900-2 resource group and when you open this you will find a storage account that we just created one additional thing that i want to show you is the resources azure com portal in here you can review a json definition that we are talking about so if you want to see the common properties for the service that they created you can find it here expand subscriptions go to the resource groups az 900 open providers select microsoft storage and in
here you'll find your storage account that we just created and all the properties within that storage one cool trick is that if you don't like this kind of navigation and you don't know how to search for the service that you just created there's a little trick that you can do go back to your resource group select the storage account and copy the url starting from subscriptions on the top just copy this part and put it here after azure resources come when you put it press enter it will automatically navigate you to the resource that you're
browsing in azure portal showing all the common properties for this particular resource a pretty cool trick so to summarize at any point in time each resource can be in exactly one resource group additionally resource groups have their own location assigned but this location is only used to store metadata so it's not impacting resources because each resource in the resource group can be in a different location if you are not sure about your strategy remember that most resources can be moved between the resource groups remember also that resource groups cannot be nested so you cannot create
a hierarchy of resource groups but most importantly when picking strategy remember to pick the strategy that fits your organization needs whenever there's a billing security access management or simply application life cycle it is really up to you to decide that what works best for your organization which brings me to our last point which is resource manager as an azure customer you can use one of many methods of purchasing services you can do it through azure portal you can also use it through rest api so you can create scripts and applications that will automate resource deployments
you can use powershell scripting if you want you can also use cli like we did in the demo or you can simply use one of many programming sdks if you want but all of those interfaces connect to the same point sending the same template at point it's a service called azure resource manager it's a centralized service governing all the resources in azure and it's that service that is responsible for creating each service within azure so for you resource management is a centralized management layer for all the resources and resource groups in azure and because it
has unified language unified template language you always send the same properties have the same validations and everything is consistent across multiple interfaces resource manager is also responsible for checking your privileges with azure active directory this is because azure active directory is a centralized identity and access management service in azure so this is where all the privileges are stored so azure resource manager will check with azure id whenever the user that is requesting resource creation deletion or changes as a proper privilege is assigned as such azure resource manager is also responsible for controlling the access and
management of the resources all the demos that we performed today went through azure resource manager in order to create those resource groups and resources but that's pretty much it resource manager is an internal azure service for building and managing our resources as with pretty much any episode materials are attached on episode 8 on my website to just go there review the materials attached check the cheat sheet and lastly take the practice test and that's it for this episode i hope you guys enjoyed it if you like what i do support the channel by subscribing liking
and commenting if you want to move to the next episode simply use playlist or hit the icon on the side and i'm hoping to see you in the next one see