Service Graph Connector for Azure - Need to populate the environment field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-16-2025 09:24 AM
Hi All we are using the service graph connector to pull the servers hosted in Azure. But the environment field is not populated, but the environment tag is available. Can you guide me on how to populate the environment from tags to server table. In the integrstionHub etl i tried to used a transform script, but im not able to find the input column containing the tags, but its in the payload. Or is there another way to do this? or how to map the tags to the environment field?
- Labels:
-
Service Mapping
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 04:21 AM - edited ‎07-09-2025 04:22 AM
Condition : envrioment should be empty, table is cmdb_ci_server, you can run async
(function executeRule(current, gsnr) {
try {
// Query the cmdb_key_value table for this CI and tag 'environment'
var kvGR = new GlideRecord('cmdb_key_value');
kvGR.addQuery('ci', current.sys_id);
kvGR.addQuery('key', 'environment'); // tag key name
kvGR.query();
if (kvGR.next()) {
var envValue = kvGR.value;
if (envValue) {
current.environment = envValue;
current.update(); // async BR so safe to update
}
}
} catch (e) {
gs.error('Error in BR Populate Environment from Tag: ' + e.message);
}
})(current, gsnr);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-09-2025 07:45 AM
Thanks for the script, but it dint work i tried to checking by deleting environment field and try to save it says skipping business rule.
Also i want to extract the environment tag from the azure connector payload. Of the 400 servers i have , 200 servers are having the environment field populated from azure but it dint know how its getting populated. the Azuretags attribute(nested object) has all the tags. Need to extract from this. But in the integrationhub etl, when i create a transform, azuretags can be found in the source field, so cant extract. Any alternative?
Sorry for the trouble
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2025 05:33 AM
You wont be able to do it from ETL, you need to update the script with the correct tag information. The script will give you the logic. Regarding how the data coming for I would say check the audit to find out.
Regards,
Pratiksha