Open In App

Microsoft Azure – Monitoring Azure Functions

Last Updated : 31 Mar, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

In this article we will how to monitor Azure Functions. In the article, we are basically going to look into the GA’ing of the new portal experience for Azure Functions. And specifically, you are going to dial into the monitoring aspects of how to monitor a function, how to see what’s going on, even when you are not in the portal. 

Implementation:

Let’s start by clicking on this function. And the first thing you are going to notice is that this is the new GA experience for managing functions in the Azure Portal. It’s a lot more consistent with the rest of the Azure Portal, including metrics in the overview blade. So, this is something that’s new for functions. 

Azure has the ability to show you metrics that are collecting all of the information for all of the individual functions that exist within your function app. So in this case, you have multiple functions deployed to this function app, so you can see an aggregate of all the executions, an aggregate of the memory that is being consumed by these individual functions. 

You can also jump into the specific function that you want to look at, and you will get the metrics that are in this case scoped to this specific function. 

As with any other resource in Azure, you can now click directly into the monitoring view, where you can basically customize this query and query for any of the different metrics that are supported for an Azure Function.

You can also go over to the code editor. And one of the things that Azure is working on is first giving you the ability to have more control over your real estate, so now this basically conforms to the browser window. You don’t get a bunch of different scroll bars. And what you will see is that you can basically run this and get logs directly here in the portal. 

In the old experience, Azure didn’t have the ability to provide this log streaming functionality for all the different combinations of flavors for Azure Functions. But now it does not matter if you are doing, for example, a Python app running on a Linux host, hosted on a consumption plan or the serverless model and doing local development where you are pushing the code from GitHub or your Visual Studio Code instance running directly on your machine or if you are doing in portal editing using C# and the Windows host and hosting it in a premium function plan, this experience is going to be consistent and Azure has this functionality across the board.

The next thing is the monitoring view. This is really good to get a glance of what is your executions over the last couple of days. You can filter here based on status code or if you have a specific operation ID that you want to look for specifically when you are doing debugging of a specific function, you can filter it here.

But you can also jump all the way over into the Application Insights experience because it has a much richer querying interface. So in this case, if you wanted to see any function that took more than ten milliseconds to execute, you could adjust a query. You can see that you have the IntelliSense built right in. So, said durations greater than ten milliseconds. And here, all of these functions took 11, 12 milliseconds to execute. 

Now the other thing that’s really powerful here is if this was a query that was interesting to you that was basically giving you a signal for something that you wanted to monitor even when you were not looking at the portal, You can get here and create a new alert that will basically go and execute this query. You can see the query right there where it’s looking at duration greater than ten milliseconds. And what you can do is let’s say if there are over 100 function executions that had over ten milliseconds of duration, and you want to do that every ten minutes, basically, look at a 10-minute window every five minutes, you can do that and it’s going to tell you what is your estimated cost for running this query every month.

And then you can choose to do something about it. For example, you can send an email or trigger a webhook with a specific payload if you are using, for example, things like pager duty or have other built-in monitoring or ticketing tools, you can basically trigger a ticket directly from here. 

And then finally, Azure also has a log tab where, again, this is basically the same streaming log experience that was shown in the coding test. But you can also from here jump directly into the live metrics view for Application Insights that basically gives you those hot path metrics that are coming literally as requested are coming in. 

So with that, you can see that Azure has a very new experience for Azure Functions in the portal that is consistent with other Azure resources that leverage all of the functionality that already exists and that you should already be familiar with Azure Monitor. And it lets you view metrics and events that are happening both at the function app level as well as the individual functions.

Hence, this is how you can monitor your Azure Functions.


Previous Article
Next Article

Similar Reads

Microsoft Azure - Enable Linux System Logs in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Enable and Collect Linux Syslog from Log Analytics agents at custom i
1 min read
Microsoft Azure - Enable Linux Performance Counters in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Collect Linux performance counters from Log Analytics agents at custo
1 min read
Microsoft Azure - Enable Windows Event Logs in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Enable Windows Event Logs to collect log data from standard logs, lik
1 min read
Microsoft Azure - Enable Windows Performance Counters in Azure for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Collect windows performance counters from Log Analytics agents at cus
1 min read
Microsoft Azure - Enable IIS Logs for Monitoring
Log Analytics is an Azure service that collects and stores information/data from a set of different sources and we can use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide a variety of insights into our data. Internet Information Services (IIS) stores user activity in the form
1 min read
Microsoft Azure Windows Monitoring Agents
Azure is Microsoft’s cloud computing platform which helps to build solutions to meet business goals. It supports infrastructure (IaaS), platform (PaaS), and software-as-a-service (SaaS) computing services. It also supports advanced computing services like artificial intelligence, machine learning, and IoT. Azure allows you to build, manage and depl
2 min read
Microsoft Azure - Heartbeat KQL Log Monitoring Query
Pre-requisites: Microsoft Azure – Troubleshoot Azure VM Process using KQL Microsoft Azure – Track CPU Utilization of Azure Virtual Machines using KQL Log Query Heartbeat is an Azure Log Management solution and you can get/fetch the below following information from the KQL Log Heartbeat query.: Computer NameAn Environment that hosts the computer: Az
2 min read
Microsoft Azure - Get Azure VM Properties using Azure PowerShell
The purpose of using the Azure PowerShell Commands is to quickly analyze the overall properties of VM/VMs at once the filtering the with select and where conditions. To find the properties of an Azure VM, you can perform the following commands in Azure Cloud Shell to get the details. Command: Get-AzVM Output: 1. Get all properties of an Azure Virtu
2 min read
Microsoft Azure - RDP to Azure Virtual Machines using Azure Bastion
In this article, we will learn how to do RDP(Remote Desktop Protocol) / SSH(Secure Shell) Connection to an Azure VM using Azure Bastion. First, let's discuss Azure Bastion. The Azure Bastion service is a fully platform-managed PaaS service that you provision inside your virtual network. It provides secure and seamless RDP/SSH connectivity to your v
3 min read
Microsoft Azure - Configure Azure SQL with Azure CLI
In this article, we're going to take a closer look at how you can configure something like connectivity using the Azure CLI. What we have here is we are in Azure Data Studio and similar to the SQL notebook we are actually using a PowerShell notebook. That just means all our code cells are going to run PowerShell and we are just connecting to localh
4 min read