Populating Azure Tag value in CMDB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 12:18 AM
Hi,
In my Azure account I have some VM's and each of VM's have asset tags , for eg. Company Location tag which is used to store location of my company . Using Discovery I have achieved cloud based integration of Azure - CMDB .
But for every Virtual machine instance asset tags are available in Azure, whereas in ServiceNow Asset tag with respect to VM is not available or not fetched from Azure. Please help to get this Asset Tag in sync with Azure.
- Labels:
-
Discovery
-
Orchestration (ITOM)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2023 12:22 PM
Thanks @Mohit Kaushik and @Ram Devanathan1 for your help.
After migrated CAPI to pattern based discovery, now able to see the tags value under key value table.
Now couple of things would like to know:
1) Are these tags(key value) will be visible in all table including cmdb_ci ? or is there any specific table where these tags info will only be visible?
2) To update the Asset Tag, can you please help me to write business rule
3) If we update the Asset Tag, will it show on all table for e.g. cmdb_ci or cmdb_ci_resource_group etc

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2023 06:20 PM
tag (key-value) records appear in related list - if not appearing out of the box, you can customize the layout to show key-value -> configuration item related list. the underlying table is cmdb_key_value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 10:46 AM
Iam new to tag based service mapping , why use tagbased service mapping for cloud and what is its purpose.please can share your insights here that might me for better understanding.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-10-2023 11:28 PM
Hi @Girija Sankar G,
This BR will help you update the asset tag on all the CI tables. I have already shared the BR which you will have to write on cmdb_key_value table in my previous replies on this question thread. Shared it again below:
try {
var grCI = new GlideRecord(current.configuration_item.sys_class_name+''); // This will work for all the CI types, if you want it to work only for VM instance table then you can put 'cmdb_ci_vm_instance' instead of current.configuration_item.sys_class_name+''.
grCI.get(current.configuration_item.sys_id+'');
grCI.asset_tag = (grCI.asset_tag) ? grCI.asset_tag +', '+current.key +':'+current.value : current.key +':'+current.value; //considering asset_tag is your Asset Tag field.
grCI.update();
}catch (e){
}
This will update your azure tags into the Asset Tag field and you will be able to see the comma separated azure tags.
Also go to your CMDB tables where you want to show the Key value pairs, open any record and in the header do right click -> Configure -> Related Lists-> (Key Value->Configuration Item). This will give you the related list of Key value pairs. And then you will be able to see the list of records in that related list associated to your CI.
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2023 06:32 AM
I have created the same BR as suggested for Asset Tag update on cmdb_ci (PFA the screenshot attached)
Ran the discovery.
Can see Tags values showing on cmdb_key_value table and updated it into Related list of Virtual Machine Instance class. It shows correct.
But still i cant see the tag value on cmdb_ci table.
Is there anything i am missing here.
Please assist.
Thanks
Giri