Microsoft Azure Alert driven discovery
The Microsoft Azure Alert service can raise alerts for any changes in the life-cycle state or the configuration of a cloud resource. You can configure the service to auto-update the latest resource information in the Configuration Management Database (CMDB) without waiting for the next scheduled Cloud Discovery to run.
During event processing, the Cloud Event Scheduler identifies the domain of the service account and assigns to the event. If an error occurs in identifying the domain before processing, the event can sometimes stay unassigned and become visible to all domains. To prevent the failed events visibility to all domains, you can set the sn_cmp.error_events.default_domain property to sys_id of the service-provider domain so that the failed events appears only to the service-provider domain administrator.
You can configure the Cloud Event Scripted REST API to receive alerts from the Microsoft Azure Alert service. For each alert—also called an event—the API creates a record in the Cloud Events [sn_cmp_cloud_event] table. The Cloud Event Scheduler reads the events from the [sn_cmp_cloud_event] table for batch processing. The scheduler invokes the pattern to process the events that are in ready state. The patterns discover the affected resource and add or update its details in the CMDB. This method helps to update the CMDB Configuration Item (CI) data and view the latest data in the Cloud User portal.
- Source: This field is always set to
azure activity log. - Event Name: Name of the event received from the Microsoft Azure console.
- Resource ID: ID of the affected resource. If there are VM events, Cloud Discovery uses this information to identify the VM.
- Resource Type: Resource type of the affected resource.
Configure the Microsoft Azure Alert service to auto-update the CMDB
Configure the Microsoft Azure Alert service to auto-update the Configuration Management Database (CMDB) without waiting for the next scheduled Cloud Discovery to run.
Avant de commencer
- Ensure that either Discovery or Cloud Provisioning and Governance is activated in the instance.
- An active MID Server with Microsoft Azure discovery capability is available.Remarque :The alert configuration continues to ping alerts even when the MID Server is down. Which in turn leads to a high number of errors in the ECC queue. If no MID Server is available, you must manually deactivate the Microsoft Azure alert rule. The Azure Alert Rules [azure_alert_rule] table contains all the Microsoft Azure alert rules.
- An active MID Server with Microsoft Azure discovery capability is available.
- ServiceNow role: sn_cmp.cloud_event_integration
- Microsoft Azure roles:
- Microsoft Azure credentials with the Reader role
- Microsoft Azure custom role with the following
permissions:
"permissions": [ { "actions": [ "Microsoft.Insights/ActionGroups/Write", "Microsoft.Insights/ActionGroups/Delete", "Microsoft.Insights/ActionGroups/Read", "Microsoft.Insights/ActivityLogAlerts/Write", "Microsoft.Insights/ActivityLogAlerts/Delete", "Microsoft.Insights/ActivityLogAlerts/Read", "Microsoft.Insights/ActivityLogAlerts/Activated/Action", "Microsoft.Insights/AlertRules/Write", "Microsoft.Insights/AlertRules/Delete", "Microsoft.Insights/AlertRules/Read", "Microsoft.Resources/deployments/write", "Microsoft.Resources/deployments/delete", "Microsoft.Resources/deployments/read" ],
Remarque :To set up the alert-driven discovery, you can use a Microsoft Azure service principal with the reader role only. For more information, see the community article Azure alert driven discovery with reader privileges.
Pourquoi et quand exécuter cette tâche
After you configure the alert service, it facilitates tracking of the life-cycle state and configuration of the Microsoft Azure cloud resources.
Procédure
Add a Microsoft Azure alert rule
Enable alert-driven discovery for a new Microsoft Azure alert type by adding it to the Azure Alert Rules [azure_alert_rule] table.
Avant de commencer
Role required: admin
Pourquoi et quand exécuter cette tâche
The Azure Alert Rules [azure_alert_rule] table contains all the supported alert types. For more information, see Supported Microsoft Azure alert types. The Microsoft Azure Alert service uses the information stored in the Azure Alert Rules [azure_alert_rule] table to raise the alerts. Cloud Discovery also supports all the alerts generated for the members of the resource group specified in the Microsoft Azure alert configuration.
Procédure
Supported Microsoft Azure alert types
The base system Cloud Discovery supports alert driven discovery for several Microsoft Azure alert types. The Azure Alert Rules [azure_alert_rule] table contains the supported alert types.
Microsoft.Compute/virtualMachines/deallocate/action
Microsoft.Network/privateDnsZones/delete
Microsoft.Compute/availabilitySets/write
Microsoft.Network/loadBalancers/write
Microsoft.Network/connections/delete
Microsoft.Network/publicIPAddresses/delete
Microsoft.Storage/storageAccounts/write
Microsoft.Network/virtualNetworks/delete
Microsoft.Sql/servers/databases/delete
Microsoft.Network/expressRouteCircuits/write
Microsoft.Network/localnetworkgateways/delete
Microsoft.Network/networkInterfaces/delete
Microsoft.Compute/virtualmachines/write
Microsoft.Network/expressRouteCircuits/delete
Microsoft.Network/natGateways/write
Microsoft.Network/loadBalancers/delete
Microsoft.Compute/virtualMachineScaleSets/delete
Microsoft.Network/virtualNetworks/virtualNetworkPeerings/delete
Microsoft.Storage/storageAccounts/delete
Microsoft.Compute/availabilitySets/delete
Microsoft.Network/connections/write
Microsoft.Compute/virtualMachines/start/action
Microsoft.Compute/virtualMachines/restart/action
Microsoft.Sql/servers/databases/write
Microsoft.Compute/virtualMachines/delete
Microsoft.Network/networkInterfaces/write
Microsoft.Network/privateDnsZones/write
Microsoft.Network/localnetworkgateways/write
Microsoft.Network/natGateways/delete
Microsoft.Compute/virtualMachines/stop/action
Microsoft.Network/publicIPAddresses/write
Microsoft.Compute/virtualMachineScaleSets/write
Microsoft.Network/virtualNetworks/virtualNetworkPeerings/write
Microsoft.Network/virtualNetworks/write
Microsoft.Sql/servers/delete
Microsoft.Sql/servers/write