Azure native way to get notified of resource addition/modification - azure

Actually I am working on an event based notification which will call a webhook/send an email in case a new resource gets added to my subscription. I could not find any Azure native service which will send me alerts/notification in case a new resource gets added to my subscription, but using powershell we can keep on polling on the resource list and workaround it, but if there is any native Azure service or function which can help me out, please inform.

You can use the azure activity log alerts to create a web hook/sms/email notification. This allows you to create a direct avenue straight from the Azure tooling. You can also use a variety of other methods to monitor your azure subscription including Log Analytics (event based logging, alerting and analytics) and App Insights (application logging and alerting)

Related

How to getting event from Event grid on successfully deplying Azure template

Say I have a https end point that can serve as a webhook url for azure event grid that I can provide in the Azure template. But that endpoint has not been validated yet. I also have an azure template that I wish for a tenant/customer to deploy. What is the way for me to receive an event that deployment of the template has finished successfully?
You may leverage Azure Monitor's capability to view activity logs to monitor actions on resources. More specifically, you'll be interested in events from the Deployments resource (Microsoft.Resources/deployments).
From there you may create an alert rule + action group that will push the event to a webhook of your choice. You may also scope your alerting to a single resource group or a whole subscription. See Create an alert rule and Create and manage action groups in the Azure portal.

Monitor specific activity logs to trigger Azure Function

Usecase: Trigger Azure Function only for predefined Azure activity logs.
I tried to configure Azure Activity logs and Export to Event Hub, but it won't allow Filter set on it. As per Azure document, the filter settings do not have an impact on export settings.
My usecase is to trigger an Azure Function only for a specific set of activity logs (say VM, VNet, NSG Create/Delete/Modify). What other Azure services can I use to accomplish this?
One option, but with some constraints, is to create Alerts at Resource Group level or even for specific resources. Alerts provide some flexibility in filtering specific events for which you would want to trigger an Action, say an Azure Func in your case.
I was thinking Azure Logic Apps would do this as well. However, to my surprise I could not find an option to add Activity Log as a trigger. Probably, it would come in the future. As Azure is updated quite frequently, keep checking every now and then to see if you get any new options to do this.

Not able to stream activity logs into Event Hub

I'm using free tier Azure account. I'm trying to configure activity logs streaming into Event Hubs as per instructions on page - https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-stream-activity-logs-event-hubs
I have created a new EventHub, Shared Access Policy called "ActivityLogsPolicy" with Manage, Send and Listen permissions.
I used this policy to configure "Export" from Activity logs however it keeps failing with error message "Create or update activity log profilesFailure"
Has anyone encountered this problem ?
I was able to get it to work as follows:
In order to make it work, you have to “Register” support for a provider called “microsoft.insights” the whole thing has look and feel of “Windows Registries” :pensive:
Search for Subscriptions in all services -> Select your subscription -> Resource Providers -> Search for “microsoft.insights” -> Enable it. Then it works
I ran into this same error after moving a subscription to a new enterprise agreement. I was not able to get it working so I needed to create a new subscription.

Is it possible to receive an event when a new resource is created

I would like to run some automation to take some actions whenever a new resource is created in One of my subscriptions in Azure. Is this possible?
You can use Azure Event grid for this, a solution that is built for exactly this purpose. Taken from https://learn.microsoft.com/en-us/azure/event-grid/overview
Azure Event Grid allows you to easily build applications with event-based architectures. You select the Azure resource you would like to subscribe to, and give the event handler or WebHook endpoint to send the event to. Event Grid has built-in support for events coming from Azure services, like storage blobs and resource groups.
You basically create a subscription to a certain event (such as specific resources being created) that can then be picked up by a webhook, or processed by Azure Automation or Azure Functions

Azure service bus statistics/Monitoring

I want to make a dashboard which shows the status of our Azure services bus queues and displays the history for "messages added to queue", "length of queue" and "messages processed" etc. Using the Azure Management Portal, I can see that most of these statistics manually for each queue.
Is there any way to get access to the data that is displayed in the Management Portal through one of the APIs as I want to combine the data from number of queues that we use into a single interface. I have searched in vain but I don't want to log my own statistics as that seems like redoing a task that Microsoft already perform.
Currently with REST API all I can see is how to get the current approximate count of messages in the queue.
There is an API for this now (wasn't back when the OP created the thread):
https://msdn.microsoft.com/en-gb/library/azure/dn163589.aspx (REST)
https://msdn.microsoft.com/en-us/library/mt348562.aspx (.NET)
Also, I believe it should be available via Azure Insights API:
https://msdn.microsoft.com/en-us/library/microsoft.azure.insights.aspx
It is possible to fetch the Count of Messages in a Queue, Incoming Messages, Outgoing Messages with the help of the latest Azure Monitor Metrics, with which you can build you own Dashboard. Or you can make use of the Azure Monitor in Azure portal, which allows you to configure dashboards and alerts.

Resources