Apply tags to resources using policies


For consistance in filtering your billing, you should take advantage of tags added using policies.

Small organizations can use it to filter out cost related to different applications, and larger organization to divide the billing into different business areas.

Policies can currently only be viewed in the Preview Portal of Azure, but will soon be available in bought.

When using the Web GUI you can assign existing rules to subscription, resource group or resources, but creating custom rules are done with PowerShell.

And here is a PowerShell module you can import and run the New-AzurePolicy command. It will ask for your input on PolicyName, PolicyDescription, PolicyFile and Resource Group, as well as looking through all the subscriptions you have access to. And make you choose which one you are applying a policy in.

But before you start creating policies, this was about creating tags applied to resources with policies, so lets have a look at an example JSON template for some tags:

The tags will be named “Application Owner” and the value will be information for the Application Owner to write in their name. Unless you allready know the value and it is going to be the same for all resources within the scope of this policy.

Hierarchi, would be to set a subscription policy, to tag all resources with a business area code or name. So you can filter out the different business areas on the bill from Microsoft, based on tags. On theĀ Resource Groups which often represents an application, you can add a tag to all resources with application code, and/or business unit within the business area. Makes it possible to continue to use tags when dividing the bill even more granular.

Or to investigate the costs related to the application, by using the Resource CostĀ in the Azure Portal. Not everyone have access to the bill itself, or the enterprise enrollment agreement portal.

Leave a Comment