Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tag a Managed Resource Group for Azure Databricks

Given that managed resource groups are mandatory for creating an Azure Databricks cluster, is there any way that I can tag the resource group in order to comply with the tagging policy on my subscription?

I am using the template here to deploy my resources.

like image 617
Joshua Howard Avatar asked Oct 07 '19 20:10

Joshua Howard


2 Answers

Unfortunately, you are not allowed to add custom tags for the Managed Resource Group created in Azure Databricks using Azure portal/PowerShell/CLI.

Reason: By default, you cannot perform any write operation on the managed resource group.

If you try to modify anything in the managed resource group, you will see this error message:

{"details":[{"code":"ScopeLocked","message":"The scope '/subscriptions/xxxxxxxxxxxxxxxx/resourceGroups/databricks-rg-chepra-d7ensl75cgiki' cannot perform write operation because following scope(s) are locked: '/subscriptions/xxxxxxxxxxxxxxxxxxxx/resourceGroups/databricks-rg-chepra-d7ensl75cgiki'. Please remove the lock and try again."}]}

Possible way: You can specify tags as key-value pairs when while creating/modifying clusters, and Azure Databricks will apply these tags to cloud resources.

Cluster tags allow you to easily monitor the cost of cloud resources used by various groups in your organization. You can specify tags as key-value pairs when you create a cluster, and Databricks applies these tags to cloud resources like VMs and disk volumes.

For convenience, Databricks applies four default tags to each cluster: Vendor, Creator, ClusterName, and ClusterId. You can add custom tags when you create a cluster. To configure cluster tags:

  1. On the cluster configuration page, click the Advanced Options toggle.
  2. At the bottom of the page, click the Tags tab.

enter image description here

  1. Add a key-value pair for each custom tag. You can add up to 45 custom tags.

Now you can see the previously added tag in the portal:

enter image description here

Reference: Azure Databricks - Cluster Tags.

Hope this helps.

like image 164
CHEEKATLAPRADEEP-MSFT Avatar answered Nov 04 '22 01:11

CHEEKATLAPRADEEP-MSFT


Based on the post I found:,

Since Feb 10 2020, the Databricks resource will propagate any tags applied to the Databricks resource to the managed resources it created.

I think the solution is more simpler now by tagging Databricks resource directly. Hope this answer (by others) works for everyone seeing this post.

like image 35
Richo Avatar answered Nov 04 '22 03:11

Richo