Integrate Microsoft Azure with Event Management. To add the Azure platform as a data source, configuration is required in the Azure platform.

Before you begin
Role required: evt_mgmt_admin and web_service_admin
The Event Management integration with Azure supports the Azure Classic Metric Alert format, also known as Insights Alerts. For this format, Event Management provides a dedicated listener, Azure Events Transform Script. Several event rules for this format are provided with the base system. For information about how to receive events from other Azure formats. For more info Servicenow Online Training
Activate the inbound event azure endpoint to enable receiving Azure platform alerts in Event Management, which works without security authentication:
- Navigate to System Web Services > Scripted Web Services > Scripted Rest APIs.
- Locate and click the Inbound Event script.
- In the Resources area, click inbound event azure.
- Select Active and then click Update.
Dedicated listener
Configure a dedicated listener that supports the Azure Classic Metric Alert format, as follows:
- Open the Azure platform transform script, navigate to Event Management > Event Listener (Push) > Listener Transform Scripts.
- In the Listener Transform Scripts page, click Azure Events Transform Script.
You can select to send Azure alerts either through the instance or the MID Server.
About this task
When an Azure platform alert message arrives, Event Management:
- Extracts information from the original Azure platform alert message to populate required event fields and inserts the event into the database.
- Captures specified content in the additional_info field.
Procedure
- In the Azure platform portal, create alert rules using the Alerts (Preview) interface.
The definition of an alert rule in Azure platform portal has these parts:
- Target: Specific Azure platform resource that is to be monitored.
- Criteria: Specific condition or logic that, when seen in Signal, should trigger action.
- Action: Specific call sent to a receiver of a notification – email, SMS, Webhook, and so on.
- In the Webhook column, specify the endpoint URL in the format: https://<instance-name>.service-now.com/api/global/em/inbound_event_azure.
- What to do next
- Receive events from other Azure formats Event Management can receive events from other Azure formats, such as Azure Activity Alert (also known as audit log), and Azure log Alert (also known as unified log). Use this generic JSON target URL to collect events from other Azure formats:https:/<<INSTANCE>>/api/global/em/inbound_event?source=genericJson. This generic URL can be used as-is, and requires an event rule to be configured to populate the correct fields in the alert.
- Example of the Transform and Compose Alert Output section of an event rule to show the configuration to receive an alert when receiving alert rules from Azure in the Azure Activity Alert format. For more details Servicenow Certification
Configure listener transform scripts
- Configure a push connector to connect to an external event source, using custom script that processes the collected event messages and transforms it to the required event format. Select to send events either through the MID Server or the instance, in each case using the URL of the required format.
Before you begin
Role required: evt_mgmt_admin
About this task
The listener transform script accepts event messages that are generated by external event sources.
Configure the connector to listen to an external event source. Using custom listener transform script, send the event messages through either the MID Server or the instance. For more skills Servicenow Developer Training
Note: You can use this generic JSON target URL to collect events:https:/<<INSTANCE>>/api/global/em/inbound_event?source=genericJson. This URL can be used as-is and requires an event rule to be configured.
Procedure
- Navigate to Event Management > Event Listener (Push) > Listener Transform Scripts.
- Click New or click the listener transform script that you want to modify, for example, AWS or Azure.
- Fill in the fields in the form, as needed.
- In the Script section:
- If the value selected for the Type field is MID, the Transform script field appears. In this field, specify or search for the name of the MID script include that accepts event messages that the required external event source generates and that the script parses into the required event format. Use this naming convention for the script: TransformEvents_<your source>
- If the value selected for the Type field is Instance, the Script editor appears. In the Script editor, enter the customized script that accepts event messages that the required external event source generates and that the script parses into the required event format.
Example, showing fields that have been transformed, being added to an event form.
(function process(/*RESTAPIRequest*/ request, body) {
/*Function that receives a JSON object, adding all its fields to the Additional information object. The field name is a concatenation of the field key and the parent field key if it exists.*/
function updateAdditionalInfo(event, field,jsonObject,additionalInfo) {
for (var key in jsonObject) {
var newKey = key;
if (field != "") {
newKey = field + '_' + key;
}
// You can do some transformation here and set fields on the event
//if(key == "MySource")
// event.source = jsonObject[key];
additionalInfo[newKey] = jsonObject[key];
}
}
try
{
gs.info("TransformEvents_generic received body:" + body);
var jsonObject = JSON.parse(body);
var event = new GlideRecord('em_event');
event.source = "GenericJson"; //TODO: Need to define
event.event_class = "GenericJsonClass"; //TODO: Need to define
event.severity = "5";
var additionalInfo = {};
updateAdditionalInfo(event, "",jsonObject,additionalInfo);
/*Iterates over Additional information JSON object and adds all nested objects' fields as fields of the Additional information object*/
var notDone = true;
while (notDone) {
notDone = false;
for (var key in additionalInfo) {
if (Object.prototype.toString.call(additionalInfo[key]) == '[object Object]') {
notDone = true;
updateAdditionalInfo(event, key,additionalInfo[key],additionalInfo);
additionalInfo[key] = "";
}
}
}
gs.info("TransformEvents_generic generated additional information:" + JSON.stringify(additionalInfo));
event.additional_info = JSON.stringify(additionalInfo);
event.insert();
}
catch(er){
gs.error(er);
status=500;
return er;
}
return "success";
})(request, body);
Integrate AWS platform as a data source
Integrate Amazon Web Services (AWS) with Event Management. To add AWS platform as a data source, configuration is required in the AWS platform.
Integrate Azure platform as a data source
Integrate Microsoft Azure with Event Management. To add the Azure platform as a data source, configuration is required in the Azure platform.
To get in-depth knowledge, enroll for a live free demo on Servicenow Training