DEV Community

Cover image for Organise your Resources with Tags
Yemisi Oyesainu
Yemisi Oyesainu

Posted on

Organise your Resources with Tags

Classifying your resources in the cloud environment is very essential. This will enable you to identify your resources based on the setup that obtains in your organisation.

Tags are used to identify resources in the cloud. They are descriptive metadata that helps you to logically arrange your resources into a taxonomy. It consists of key-value pair. That is, a tag is a label made up of a key and an optional value.
It can be applied to Azure resources, resource groups, and subscriptions.

It helps in identifying cost of different business processes in the cloud. Organisations can use tags to identify billings associated with each departments cloud resources usage. For example, The employees' names and their departments may be used as a key-value pair:

Name of Employee Department Tag(key:value)
Gladys Procurement Gladys:Procurement
Richard Finance Richard:Finance
Catherine Sales Catherine: Sales

Other parameters can be used to create a key:value pair depending on the Company's setup and mode of operations.

Next, we will see how Resource tagging can be implemented in Microsoft Azure. The following steps will guide you

Step 1
Log in to azure Portal
Image description

Step 2
Type 'Policy' into the Search bar and click on it

Image description

Image description

Step 3
Click on 'Assignments' to Assign a Policy

Image description

Then Click on 'Assign Policy'

Image description

Image description

Click on the small box in front of Policy Definitions and wait for it to come up

Image description

Image description

Type Tag in the Search box of the Available Definitions and Select 'Require a tag and its value on Resources'
Then Click on 'Add'

Image description

Image description
Go to Parameters and give the Tag a name and the Tag value too
The name will be Company and the Value will be Eunicloud
Therefore, the Key:Value pair is Company:Eunicloud
Please note that tag values are case sensitive.

Image description

Click on 'Review and Create'

Image description

Then, Click on 'Create'

Image description

A policy assignment was created to implement resource tagging.

Step 4
Go back to Azure portal Home page and click on Storage account

Image description

Image description

Click on 'Create'

Image description

Complete the Project details and Instance details
I will select my subscription, Azure Pass Sponsorship and Resource group is UniRg

Image description

The name of my Storage account is yemmystore (this is a random name. You can give yours any name of your choice) and I will select East US for the Region

Image description

Click on 'Review'

Image description

The Validation of the Storage account failed and could not be created. This is because of the Policy that is already assigned, requires that any resource to be created should be tagged Company:Eunicloud
Therefore, we have to assign the tag to yemmystore so that it can be created

Image description

Then Click on 'Review'

Image description

Then, Click on 'Create' and wait for the deployment to complete

Image description

Image description

The Storage Account yemmystore has been created with the tag
Company:Eunicloud

Image description

Step 5
Go back to the Home page of the Azure portal and select Policy

Image description

Click on 'Assignments'

Image description

Then Click on the Assignment name 'Require a tag and its value on Resources'

Image description

Click on 'Delete Assignment'

Image description

Select Yes in the Dialog box

Image description

The Policy assignment has been successfully deleted

Image description

Image description

I hope this is useful. When next you are creating your resources, try it out. Your workload will be well organised.

Comments are welcomed.

Top comments (0)