Get custom events in schedule function azure app insights - azure

I have to get all custom events that contain certain string on the name, with a scheduled Azure function.
Ideally I would like to send an email if a specific custom event have some wrong data.

The built in alerting features don't let you do this (run an arbitrary query and alert if some specific condition)
However, a lot of people are using Microsoft Flow, and there's some example scenarios there.
Other people have created azure functions to do similar.

Related

How to report the Obsolete assets in Azure?

I want to send an Email with all the obsolete assets in Azure that are no longer actively used within 3 months. I need to send this email every day. There is no Azure native option available. Am I missing any built-in method which can be used?
AFAIK there is no native way to send such report, so you need to prepare your own solution. This would involve steps:
tag obsolete assets
query all resources with specific tag (Powershell, AzCLI)
process query result to see them as report you like (azure function, logic app)
send report by mail (azure function, logic app)
Example almost ready to use you may find at https://www.blueboxes.co.uk/how-to-create-azure-resource-graph-explorer-scheduled-reports-and-email-alerts

How to add HTTP trigger in Azure Logic Apps

I want add a functionality in my ADF pipeline which will send me email notification in case of failure. On searching the internet, I came to know that Azure Logic Apps helps with this. I am trying to follow below link to achieve this.
https://microsoft-bitools.blogspot.com/2018/03/add-email-notification-in-azure-data.html
I have tried searching up many tutorials, guides and the official docs as well. However, all of them have some templates already there in the Logic Apps Designer. I cannot find the templates and the 'When a HTTP request is received' trigger is also not available in the drop-down.
Please let me know how to proceed.
EDIT :
If you start with a blank Logic App, search for 'HTTP' or 'Request' and select Request.
On the next screen under triggers, select "When a HTTP request is received" and you should be good to go.
EDIT:
It looks like you created a Standard Logic App, which works in a slightly different way. For instance it can contain multiple workflows, which means you create workflows yourself. In the Consumption model, there's one workflow withing a Logic App, so you can open up the editor for that one directly. If there's no explicit reason for you to use Standard, a Consumption Logic App will be easier to work with.
If you really need a Standard Logic App, go to 'Workflows' and create a new workflow:
Then click the newly created workflow to edit it, go to 'Designer' and search for 'HTTP' to add an HTTP trigger:
Here's some information on the Consumption model for Logic Apps:
Resource type
Benefits
Resource sharing and usage
Limits management
Logic App (Consumption) Host environment: Multi-tenant Azure Logic Apps
- Easiest to get started - Pay-for-what-you-use - Fully managed
A single logic app can have only one workflow. Logic apps created by customers across multiple tenants share the same processing (compute), storage, network, and so on.
Azure Logic Apps manages the default values for these limits, but you can change some of these values, if that option exists for a specific limit.
See Resource type and host environment differences for a comparison with the other hosting options.
I was able to solve this. I wasn't able to view a few functionalities because of another error : Functions runtime error Microsoft.WindowsAzure.Storage: Value cannot be null. (Parameter 'connectionString').
AzureWebJobsStorage App Setting was missing which caused the error. I added that and now I can see the triggers and other stuff.
Thanks #rickvdbosch

Trigger Azure Action Group from a Logic App

I have a Logic App running every minute that checks the time that data was last received in a table. If it has been enough time since the data was updated I want to receive an alert. I really like the Action Groups used by the Alerts in Azure. They are clean and have lots of options like email, SMS, and Phone. How can I trigger an Action Group from my Logic App?
I know I can recreate the email, SMS, and Phone connections in the Logic App, but then it's harder to maintain. I'm already using the same Action Group for other Alerts. It would be easier to maintain if I could reuse this Action Group.
There is ton online about triggering a Logic App from an Action Group. This is NOT what I'm trying to do. I want the reverse. I want to trigger an Action Group from a Logic App.
How can I trigger an Action Group from my Logic App?
Currently as per the documentation We can trigger a particular logic app using the action group but there is no way to trigger a particular action group using logic app.
It would be easier to maintain if I could reuse this Action Group.
Yes, you can use same action group in multiple alert mechanisms.
Would suggest you to raise a feature request using this azure support link.
You should be able to send data to a custom log in Log Analytics from your Logic App using Azure Log Analytics Data Collector.
Then you can use a Log Analytics query to evaluate resources logs every set frequency, and fire an alert based on the results. Rules can trigger one or more actions using Action Groups. - see Create, view, and manage log alerts using Azure Monitor.

Is it possible to detect an table/queue/fileShare creation with eventGrid?

In the MS documentation, at the resources of EventGrid Azure Blob Storage as event sources. There is nothing about table/queue/fileShare creations.
I saw also custom events in EventGrid, so i wondered if it is possible to use table/queue/fileShare creations as custom events. If yes, how?
Unfortunately, there is no direct way you can pass events like table/queue/fileshare creation to Event grid. Event grid supports mostly blob actions like what is listed HERE.
As a work around, you can look at is using alerts. Click on "Alerts" under the Monitoring tab on the left pane of your storage account. There are different types of actions available by which you can pass the administrative events to Azure functions, logic apps or webhooks. If you really need the events in Event grid, you can use logic apps/functions to pass those events/alerts to Event grid.
You may need to do some more filtering before doing this though to get exactly what you want. Else you may end up getting all the admin activities which I don't think you would need.
For example, what I setup below alerted me on creation and deletion of queues(among other things). I would also get alerts for List of storage keys and other admin activities.

How do I change the Azure Logic App Frequency and Request type

How do I change the Azure Logic App Frequency and Request type (Not programmatic ally)
Frequncy and Request type
Thank you for providing a screenshot! So the REQUEST and FREQUENCY info that you're seeing on the Overview section relate to the specific Trigger that you're using in your Logic App. Different triggers will show different info here depending on how they're designed to operate & work.
In your case, it looks like you're using one of Logic Apps' built-in connector called Request which will trigger workflow in your Logic Apps whenever a request is received to its endpoint hence manual and on-demand.
To change this trigger, navigate to Logic Apps Designer view under DEVELOPMENT TOOLS in the Azure Portal as shown below:
Moreover, I recommend reading Logic Apps' documentation here and finding more about triggers and actions; overall concepts behand Logic Apps. Hope this helps and goodluck with your journey on Logic Apps!

Resources