有没有办法在firewall rule is added to an Azure SQL database时获得警报?我检查了监控刀片,但没有看到针对此的度量标准或日志事件。
您可以使用逻辑应用程序来实现:
条件应为Status = Activated,OperationName =“Microsoft.Sql / servers / firewallRules / write”。 2.在Monitor中创建一个新警报。资源将是您的SQL Server,信号将是“所有管理操作”。创建新的操作组并设置webhook操作。在上一步中使用逻辑应用程序webhook url generate。
{
"headers": {
"Connection": "Keep-Alive",
"Expect": "100-continue",
"Host": "abc.logic.azure.com",
"User-Agent": "IcMBroadcaster/1.0",
"X-CorrelationContext": "abc",
"Content-Length": "1350",
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"schemaId": "Microsoft.Insights/activityLogs",
"data": {
"status": "Activated",
"context": {
"activityLog": {
"channels": "Operation",
"eventSource": "Administrative",
"eventTimestamp": "2019-03-09T10:00:36.549+00:00",
"eventDataId": "eventid",
"level": "Informational",
"operationName": "Microsoft.Sql/servers/firewallRules/write",
"properties": {
"originalEventTimestamp": "03/09/2019 10:00:17",
"correlationId": "correlationId",
"eventId": "eventId",
"eventName": "OverwriteFirewallRules",
"operationName": "Microsoft.Sql/servers/firewallRules/write",
"status": "Succeeded",
"description_scrubbed": "description",
"caller": "[email protected]",
"callerCredentialType": "LiveId",
"eventChannel": "OperationLogStore",
"ipAddress": "useripaddress",
"eventSource": "SQL Databases Event Supplier"
},
"resourceId": "resourceId",
"resourceGroupName": "groupname",
"resourceProviderName": "MICROSOFT.SQL",
"status": "Succeeded",
"subscriptionId": "subscriptionId",
"submissionTimestamp": "2019-03-09T10:00:36.549+00:00",
"resourceType": "microsoft.sql/servers"
}
},
"properties": {}
}
}
}