How to to copy the tags and populate in the respective fields in the Server Class

MalathiP2130156
Tera Contributor

Hello Everyone,

 

The Infra team is managing tags for Cloud Hosted VM in Azure Portal and through SG-Azure, the tags are discovered either as a VM Instance or Cloud Resource. 


The requirement is tags are stored in cmdb_key_value table. How to copy those tags and to get that populated in the respective attributes in the Server class.

2 REPLIES 2

pavani_paluri
Kilo Sage

Hi @MalathiP2130156 ,

 

The Azure tags discovered through SG-Azure are stored in the cmdb_key_value table and, unfortunately, there is no out-of-the-box capability to automatically populate those values into fields on cmdb_ci_server.

What I've typically seen customers do is use a Business Rule, Flow, or Scheduled Job to read the required tags from cmdb_key_value and update the corresponding attributes on the Server CI.

 

For example:

Environment tag → u_environment
CostCenter tag → u_cost_center
Owner tag → u_owner


The process would be:

  • Identify the Server CI associated with the tag record.
  • Read the required tag values from cmdb_key_value.
  • Update the matching fields on cmdb_ci_server.
  • Trigger the update whenever a tag is added or changed.


If the tags change frequently, I'd recommend a Business Rule for near real-time updates. If the volume is large and changes are less frequent, a Scheduled Job may be a better option from a performance perspective.

Personally, I'd keep cmdb_key_value as the source of truth and sync only the required tags to CI attributes rather than duplicating all tag data.

 

Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Pavani P

 

Hi @pavani_paluri ,

 

Here in my customer, SGC-Azure is configured and the tags are populated for Cloud Resource CI and not for the Server CI. So, in this case not sure how to fetch the tags from the cmdb_key_value table and to populate in the respective Server class custom fields.