Azure Policy - Setting up Alerts using Logic app - azure

Is it possible to integrate the Azure Policy with Logic App for configuring Alerts and sending emails, when a Policy is non compliant and the service/resource created against it so that logic app gets triggered.

At the moment, we allow for alerts from Activity log. The log logic is different from new services that are non-compliant and when we do our periodic scan. We log when we do the evaluation and a resource is non-compliant. These alerts are subscription based.

Related

azure log search alerts with log messages in the email

we write custom logs to appinsights (Structured logging)
Question:
Is there a way to include the all log statements in the email that gets generated via azure custom log alerts ?
or is a webhook/PS script required ?
Thanks -nen
You can use azure logic app services which are useful for automating workflows that connect your apps, data, services, and systems.
Im try to fetch all the log statements from appinsights using Visualize Analytics query or Run Analytics query action of Azure Application Insights Connector just by adding Connection name, Application Id and API Key.
In the next step you can add Send an email (V2) action of Office 365 Outlook connector and send all the log statements in the email.
Below is the flow of my logic app
RESULTS:
In my Inbox
You can also refer to the tutorial from Automate Azure Application Insights processes by using Logic Apps
REFERENCES:
Overview for Azure Logic Apps
Azure Application Insights

DeployIfNotExists policy at Subscription level

I am trying to enable Diagnostic Settings of subscriptions using a custom policy. But, the compliance report always shows 0/0; basically it is not identifying the subscriptions under a management group. To confirm this behavior, I created a custom policy, duplicating the BuiltIn policy "Enable Azure Security Center on your subscription". It is also showing 0/0. Is there any limitation to deploy something using a DeployIfNotExists policy at subscription level?
Azure Policy is capable of deploying resources at the Subscription level. Are you sure that your scope for the Policy Assignment is set at the parent Management group of your Subscriptions?
This should be what you are looking for. There are examples in this directory for creating diagnostic settings for Activity Logs on a Subscription that point to a Storage Account, Log Analytics Workspace, or an Eventhub. Below is a link for a deployIfNotExists policy that points to a Log Analytics Workspace.
https://github.com/Azure/Community-Policy/blob/master/Policies/Monitoring/deploy-diagnostic-setting-for-activity-log-log-analytics/azurepolicy.json
(all credit for this policy to the original author)

Azure Event Grid not sending events to webhook

I have an Azure media services account for which I want to be notified via webhook when encoding jobs are finished. I'm using v3 of the Media Service API.
I've added an event subscription to this account and have sucessfully validated the webhook endpoint.
Here's where the problem comes in. If I do something that should trigger an event(start an encoding job, create an asset, etc.) on the Azure Portal nothing happens event wise. Looking at the event subscription on the Portal shows no events detected as well.
Is this an Azure bug or am I missing something?
As it turns out, actions done through the Portal or v2 of the API does not trigger Events from Event Grid.
I used Azure Media Services Explorer to test out my webhooks instead.

Azure Create Resource Monitoring Webhooks using Rest API

In Azure is it possible to create an alert, with a webhook, if any of my resource goes up or down(not service, but resource)? I see many alert conditions but none of them do plain up/down monitoring.
Is it possible to create these alerts (with a webhook) programatically using REST API(without logging into Azure portal), once i get the required authorization? Currently I am unable to find any create alert REST API
Thanks.
Ok, I found out how to do this.
The REST API provided by Azure for monitoring can be used to create new Action Groups and create new Alerts.
The document here gives more details: https://learn.microsoft.com/en-us/rest/api/monitor/actiongroups
https://learn.microsoft.com/en-us/rest/api/monitor/alertrules/createorupdate

Azure - monitoring resources using REST APIs

I am new to Azure and have been going through various tutorials.
I am looking specifically at Azure Monitoring using REST APIs.
What I am trying to do is get the status of various resources like Virtual Networks, AD, Load Balancers etc on a custom dashboard using REST APIs.
I have found some list of REST APIs that allow monitoring here(https://learn.microsoft.com/en-us/rest/api/monitor/)
But do they provide Resource health and Status.Also, do i have a create a new Service API Managament Resource(which is a paid resource) in the Azure Account for these APIs to run?.
Please let me know if you have any insights or reference materials on this
I don't think rest API is good for monitoring. I will suggest use Azure Monitor service under that you can use Azure resource metrics, Activity logs and service health. based on these metrics and logs you can set alert and show live data on the dashboard.
We are using Microsoft OMS for live monitoring (visualization of data) and Email/SMS for notification.
List item
Audit and receive notifications about important actions in your Azure subscription

Resources