The Wayback Machine - https://web.archive.org/web/20241006112259/https://www.geeksforgeeks.org/microsoft-azure-monitoring-azure-functions/
Open In App

Microsoft Azure – Monitoring Azure Functions

Last Updated : 31 Mar, 2023
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

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
Microsoft Azure - Get CPU Utilization Data of a Azure VM in Azure Portal
Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers. In this article, we will look into the process of getting the CPU Utilization data of an Azure VM in Azure Portal. Implementation: Follow the steps to get the CPU Utilization of an Azure VM in Azure Portal: Step 1: Log in to your Azure
2 min read
Microsoft Azure - Archive Azure VM to Azure Storage Account
In this article, we will be implementing a solution to archive a select azure VM snapshot to a select storage account for archiving using azure cloud shell. For implementation, we will be using Azure CLI commands. Prerequisite:VM SnapshotA storage account is neededUser needs "Storage Blob Contributor Data" IAM Role Access on Archiving Storage Accou
2 min read
Microsoft Azure - Check Status of Azure VM using Azure PowerShell
The following Azure PowerShell command helps you to find the Azure VM Config and properties details of Os Name, Os Version, Hyper V Generation, Disks properties, Extensions properties of Type Handler Version, Status and Message, VM Agents properties of Type Handler Version, Status and Message and also VM Power Status Codes, Messages, Plugins, Time
3 min read
Microsoft Azure - Azure VM Disk Space in Percentage using Azure KQL
Here we'll be using the Azure Insights Metric Query to find the free disk space in percentage using KQL. The purpose of this query is to find disk drive free space of all the Azure VMs without logging into every server. You can Run the following KQL log Queries in Azure Monitor or Azure VM Logs or Log Analytics Workspace. Note: VM Insights Agent sh
1 min read
Microsoft Azure - Enable Azure Monitor VM Insights Agent For Azure VM
Azure Monitor VM Insights Agent enables you to get more visibility into the health and performance of your Azure VM. Here we'll see how we can enable Azure Monitor VM Insights to monitor the health, performance, and dependencies of azure virtual machines. Implementation: Follow the below steps to enable Azure Monitor VM insights agents for an Azure
2 min read
Microsoft Azure - Azure CLI Commands to Manage Azure VMs
Azure Command-line interface is used to manage or to create Azure resources. By using the simple AZ CLI command we can manage Azure VM quickly and at a Scale. Let's get started by using a few important Azure CLI commands to manage Azure Virtual Machines. 1. Start a Specific Stopped VM in a Select Resource Group Use the below command to start a spec
2 min read
Microsoft Azure - Manage Azure VMs using Azure PowerShell Commands
Here we are using Azure PS Commands to manage azure resources from Azure Cloud Shell or by using Windows PowerShell. By using the simple AZ PS command we can manage Azure VM Quicks without any efforts of navigating in Azure Portal and at Scale. Let's get started by using the major Azure PS commands to manage Azure Virtual Machine. 1. Start a Specif
2 min read
Microsoft Azure - Query Azure Storage Logs in Azure Monitor Log Analytics
Pre-requisite:- Azure Log Analytics is a tool offered by Azure, which is used to edit and run log queries against data in the Azure Monitor Logs store and helps interactively analyze their results. One can easily use Log Analytics queries to retrieve records that match particular criteria, identify trends, analyze patterns, and provide various insi
5 min read
Microsoft Azure - Install Azure Command Line Interface (Azure CLI)
Azure CLI is a very powerful tool that can be used to automate tasks, create, update, manage or delete azure resources or to troubleshoot problems with az module cmdlets. By installing az modules on your system or on your development system you and your development team can easily create, update or manage Azure AD and Azure resources such as manage
4 min read
Microsoft Azure- Backing Up, Restoring, and Cloning Microsoft Azure App Services
Microsoft is well known for developing relevant software which are using in today's time of technology to conquer the demand of users and developers to build up applications. In sequence of it Microsoft introduces Azure well known as Microsoft Azure to make quality applications. In this article, we will discuss Backing up, restoring and cloning Mic
8 min read
Microsoft Azure -Create a User in Microsoft Entra ID from Azure Portal
A user in Microsoft Entra ID is an individual who can get access to Azure identity. This Microsoft Entra ID identity can be used to access applications and resources that are protected within the organization or project. Users can be created manually or automatically, and they can be assigned to groups and roles to control their access permissions.
3 min read
Microsoft Azure- Disk Storage in Microsoft Azure
Azure Disk Storage is the only shared cloud block storage that supports both Windows and Linux-based clustered or high-availability applications via Azure shared disks. There are two types of Disks in Azure : Managed Disks Unmanaged Disks.Managed DisksSimplest optionLower management overhead as Azure manages the storage accounts.Only LRS replicatio
6 min read
Microsoft Azure - Deploy Azure Functions using VS Code
In this article, we will learn how to deploy Azure functions with Visual Studio Code. To deploy an Azure function out from within Visual Studio Code, we are going to open the command palette. Now follow the below steps to deploy the Azure function: Step 1: First, we are going to type "deploy function" in the command palette and select the option fr
2 min read
Microsoft Azure - Debugging Azure Functions using VS Code
In this article, we will learn how to debug Azure functions with Visual Studio Code. To start debugging Azure functions inside of Visual Studio Code, all you need to do is start off by creating a breakpoint, and now we'll just engage the debugging session. To do so follow the below steps: Step 1: First, in the command palette, we'll hit "Start debu
2 min read
Microsoft Azure - Creating Azure Functions From VS Code
In this article, we will look into how to create an Azure Functions project with Visual Studio Code. To start working with Azure functions inside of Visual Studio Code, we're going to need to make sure that we have the extension of the Azure functions is installed. So inside the marketplace, we are going to type "Azure Functions," and we're going t
2 min read
Microsoft Azure - Renewing or Revoking Azure Functions Keys
In this article, we will learn how to renew or revoke azure function keys. Azure function keys are used as authorization keys to the azure function app. We will go through step by step in the rest of the article to renew or revoke azure function keys. Steps:Step 1. Create a simple azure function app as shown in the article. After creating a functio
2 min read
Microsoft Azure - Renaming an Azure Functions
In this article, we will look into how to rename Azure Functions using the console. Renaming an Azure function: One common question that people working with Azure Functions face is renaming their Azure functions. Let's take a look at how we can achieve the same. Here inside of the Azure portal, we have a function and this is called "Demo." It's jus
2 min read
Microsoft Azure - New Features in Azure Functions
In this article we will learn about the all-new and improved Azure Functions experience. In this article, we will look into the new preview for the Azure Functions experience. When you come to the Azure Functions UI, this is something that you should already be familiar with, but Azure has this new banner that will take you to the preview experienc
3 min read
Microsoft Azure - Testing Azure Functions
In this article, we will explore the ways of testing different Azure Functions. This includes, for example, running tests of HTTP trigger functions using Postman and using Microsoft Storage Explorer to test Azure Blob triggers, Queue triggers, and other storage-service-related triggers. Prerequisites: Install the following tools, if you haven't alr
2 min read
Microsoft Azure - Custom Handlers for Azure Functions
In this article, we will learn how to create custom handlers for Azure Functions. Custom handlers are lightweight web servers that receive events from the Azure Functions host and can be implemented with any language that supports HTTP calls. Let's create a custom handler function app. To create a custom handler, you need to install the latest vers
3 min read