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
‎07-25-2022 04:52 AM
Hi,
You already have the pattern steps available in your pattern extension steps to fetch the Azure tags. Now this value is going to cmdb_key_value table and it is getting populated automatically via above extension step.
All what you need to do is, go to your cmdb_ci_vm_instance record and in the header do right click -> Configure -> Related Lists-> (Key Value->Configuration Item).
And then you will be able to see the list of records in that related list associated to your CI. You need to write a Business Rule on cmdb_key_value table.
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.
Please mark this as correct and helpful if it resolved the query or lead you in right direction.
Thanks,
Mohit Kaushik
Community Rising Star 2022
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2022 06:31 AM
Hi
Regards,
Mohit Kaushik
Mohit Kaushik
ServiceNow MVP (2023-2025)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-04-2022 12:35 PM
Hi Mohit,
I am new to servicenow discovery but i have good exposure in BMC discovery.
Here is SN discovery, my client wants to see the Azure Tags in to CMDB.
we want Tags value to be visible on cmdb_ci_resource_group.
While scanning the Azure VM, in the ECC queue, cant see pattern "Azure VM (LP)" is executing.
Can you please guide me step by step how to achieve this ?
TIA
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2022 05:18 AM
Hi @Girija Sankar G ,
The reason you are not able to see that pattern in ECC queue could be the discovery running on CAPI and not patterns. So, first thing you should migrate the discovery to pattern based which can be done with the help of below KB article. Once done you should be able to see this pattern getting executed and based on my previous responses on this post, you can have a business rule to populate the tags from cmdb key value table to your CI.
KB article: https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0827153
Mohit Kaushik
ServiceNow MVP (2023-2025)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2022 07:55 PM
All tags for the virtual machine should be already coming in via discovery pattern (or via CAPI if you are using CAPI discovery). we pick up the cloud tags by default. the pattern extension is already present.
Note that these discovered cloud tags are stored in cmdb_key_value table. These will appear in the related list for the virtual machine record, please add the key-value from related list configuration.
The discovery will not update your asset tag field directly. To update your asset tag field, you would need an additional step - maybe you can have a Business Rule to update the CI's asset tag field, or you could also modify the pattern.