Time of activation of Azure Alert - azure

I have an Application Insight resource on which I activated an Alert rule.
I created this rule around 12:00 so i receive the emails on that time. It is possible to set the hour of reception of this mail in an arbitrary hour?

If you're using azure alerts, it is impossible.
You can take a look at Automate Application Insights processes by using Logic Apps which can help you for this issue.

Related

How can we set an alert, in Azure Application Insight, If daily data volume limit is crossed?

I want to send an alert to application Insight specific user/users(Other then subscription administrator) when daily data volume limit is reached in application Insight.
The current answer: "Not right now"
From the team that owns this functionality:
We will be making this a proper metric that customers can use as a regular metric, then they can do any metric alerts and other scenarios they want to do (including SMS, etc.)
It’s on the backlog to fix this experience correctly.
so right now, no you can't alert on it.
subscription admins should be getting an email when you hit the cap, and if you go to the activity log for that application insights resource, you should be able to see an operational event for it:

monitor heartbeat on azure vm

We shut down our azure vm's every day at 11pm and start them at 7am, except for weekends.
Is there a way we can check the heartbeat on weekdays only between 7.30am and 10.30pm to see if the server is alive and working?
If so, how can I send a mail for the servers that miss the heartbeat during that time?
There doesn't seem to be any support from any Azure service for creating monitoring or alerts that fire only between certain hours.
It seems Azure monitoring, Log Analytics or specific service alerts (like specific a VM) all assume the alerts should be active at all times.
Some possible solutions that might work that I came up with:
If you need to use Azure services, you could create an Azure Automation PowerShell runbook
Set it to trigger regularly (every hour?) and in code handle the time interval you are interested in
Also, in code do the testing if the service is up
In my opinion, feels a bit hackish..
Use some external tool for monitoring your services, like e.g. Nagios
See e.g. this link for how it could work

How to enable alerts on Azure runbook?

Is there a way to monitor the number of times a runbook has been called and then report on it (send email, text)? When I try to create an alert rule I only see an option for activity log not metrics. The runbook is getting called from event grid via webhook.
You can use automation runbooks with three alert types:
Classic metric alerts - Sends a notification when any platform-level metric meets a specific condition. For example, when the value for CPU % on a VM is greater than 90 for the past 5 minutes.
Activity log alerts
Near real-time metric alerts - Sends a notification faster than metric alerts when one or more platform-level metrics meet specified conditions. For example, when the value for CPU % on a VM is greater than 90, and the value for Network In is greater than 500 MB for the past 5 minutes.
When an alert calls a runbook, the actual call is an HTTP POST request to the webhook. The body of the POST request contains a JSON-formated object that has useful properties that are related to the alert.
This Microsoft documentation link might help for metrics alerts for runbook :
https://learn.microsoft.com/en-us/azure/automation/automation-create-alert-triggered-runbook
You can send your Azure Automation runbook status data to Log Analytics. From there, you can alert on the different states. This documentation should help you with this process: https://azure.microsoft.com/en-us/updates/send-your-runbook-job-status-and-job-streams-from-automation-to-log-analytics-oms/
There are multiple answers to this question although none of them are a perfect solution. What I ended up doing was putting a logic app in front of the runbook that then calls the runbook. This allows me to alert on the metrics of my logic app.
We have just added support for Monitoring runbooks and having Alerts on it. Please go to the Alerts experience in Azure Monitor where you should be able to choose an Automation Account and then a Runbook as a dimension and then perform actions based on number of jobs of the Runbook etc.

Azure Approach to proactive Logging

I am working on Azure web API which uses Log4Net Application Insight appender to track traces. We are planning to use the Application Insight SDK directly (TrackTrace(), TrackEvent()) in order to use built-in alerting features.
However it does seem like, Azure is not supporting trace or event alerts but only metric alerts. So we got some issue there.
If I go one step back, web API is invoked by number of Logic Apps runs in x time intervals. Logic App simply calls web API (business logic is here) and it log all information/managed exceptions.
The main requirement is to be proactive when an exception happens like sending a mail to technical inbox. Secondary requirement is notify sources, if it got any data issues.
Any suggestion on our approach please, what we can do more to fulfill our requirements?
Please refer to this App Insights Exception Alerts. It is possible to set alerts for rates of exceptions in a defined time period.
Set up Exception alerts
You can also invoke webhooks to perform additional actions when the alert is fired.
Thanks Sreejit for your suggestion.
To conclude the answer, what's the preferred engine to process alerts please, through application insight or log analytics?
application insight only support metric alerts only, so the application exceptions need to be flagged as custom metrics as opposed to traces.
[TelemetryClient --> TrackTrace() vs TrackMetric()]
If we go for log analytics, we can use custom events. Then use alert management solution in OMS workspace. Perhaps even use of a separate logic app to built the logic of sending alerts.
[TelemetryClient --> TrackEvent()]

Questions about Azure resource management portal

I've recently been playing around with the Bing's image search api, however I have a concern I hope to resolve.
It is to do with the limit on the number of api requests that are allowed per month. After doing some reading it seems like if I were to exceed this limit, my Azure account would be billed depending on the number of api calls I have gone over my limit. Is it possible to set up some kind of alert through the Azure management portal that will stop the api from processing any more calls once a specific threshold has been passed?
If anyone has any experience using the Search api and can enlighten me, that would be great.
Try Metrics Monitoring. Go to the service within Azure Portal, Scroll Down to Monitoring -> Metrics and then click Add Metric Alert.
You can create an alert based on the number of successful calls or total calls and the alert can notify you via e-mail. Additionally, if you want to take action automatically after reaching the threshold, you can use Webhooks to make a call out to a web application or Azure Automation Runbook to automatically run PowerShell scripts or some code to prevent overuse. You can also use Logic Apps for that. Check the following link for further details and examples at the end of the page:
https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/insights-webhooks-alerts

Resources