Let's look at one more way to organize resources in azure
tags are name value pairs that you can apply to resources and resource groups. In azure,
you can think of tags as textual metadata that you can add to your resources.
You can use tags to add additional information to resources that is meaningful for your organization.
You can have up to 15 tags for resource, and each tag key is limited to 512 characters, except for azure storage resources like blocks, tables and queues, where tag keys are limited to 128 characters,
tag values are limited to 256 characters.
Tags are not inherited from the parent resource.
the tags applied to a resource group are not automatically applied to the resources in the resource group.
Also, not all resources in azure support tags yet,
but let's see how we can apply tags to resources using the azure portal.
The first thing we will do is we will apply tags to the resource group.
You can choose the resource group by going to resource groups on the left and selecting the resource group
in the overview blade you will see there is this line called Tax.
You can click here to add tags to the resource group.
We'll add two tags here.
One will be cost center and we will say learning
The second one will be owner, and I'll put the course architects name there.
When you click, save the tags will be applied.
They will also appear where the link was previously.
We applied those tax. However, those tags are applied only to the resource group.
If you click on the resource itself, you will see that there are no tags applied to the resource.
As you can see, the resource has no tags applied to it. We can click here and apply completely different tags to the resources inside the resource group.
Let's say for the vignette, we can do owner again. That will be the course architects name.
We can do environment for the resource group, and we'll say this is training.
Actually, this is for the resource, not for the resource group.
we have the owner and environment tag for the virtual network.
We have the cost center and the owner tags for the resource group,
and this is how you apply tags to different resources and resource groups. In Azure,
you can use tags in many different ways.
One common scenario where tags are used is for billing purposes.
For example, you can tag each resource with a tag cost center and add the toss center as a value for the resource.
Then you can easily pull a report that gives you the consumption of resources for each individual cost center using the tag.
And you can do this using azure billing APIs or by exporting the data from the cost management blade in Azure portal.
You can also use tags to manage the resources and releases.
For example, after deploying V two of your product, you may want to shut down the resources for V one and eventually terminate them later on.
Tags are also helpful for monitoring purposes. For example, you can tag resources with owners, and if a resource fails, you know which department needs to be notified.
You can also create automatic alerts to be sent based on the tag values.
You can also use tags for automation.
Let's say you want to save on your computer power and shutdown VMS in different regions based on working hours.
You can use tags to specify, start and stop times for the day and use azure automation to start and stop the VMS every day
and last. But certainly not least, you can use azure policies to enforce standards.
Now you know how you can use tags to add additional organization principles to your resources in Azure.