Azure Functions now with Application Insights integration

April 30, 2017

Earlier this month Azure Functions was updated to have direct integration with Application Insights and is currently only available on the “beta” version of Azure Functions. At this time it’s recommended to only try this out in non-production Azure Function apps until it’s a more stable release.

Getting Started

Before we can enable Azure Function Application Insights integration, we will need to setup an Application Insights instance. If you already have one skip to the next step.

  1. Create an Application Insights instance and Application Type should be General. Once your Application Insights is setup, copy the instrumentation key which we’ll need in the next step.
    image
    image
  2. Next you will need to update your Azure Function Application Settings to configure your function to run under the “beta” version and then to set your Application Insights Instrumentation Key.image
  3. Now go to Application Settings and then update App Setting “FUNCTIONS_EXTENSION_VERSION” from “~1” to “beta” and then add a new key named “APPINSIGHTS_INSTRUMENTATIONKEY” and set the value to the Application Insights Instrumentation key you copied in step 1. Now click Save to update your Azure Function.
    image 

Once this is done, your Application Insights instance will start collecting telemetry from your Azure Function without any code changes.

Using Application Insights

Going to your Application Insights, you can start to see some metrics showing up on the overview blade:image

Live Metrics Stream

You can get a lot more insights to real-time telemetry from the Live Metrics Stream to see what’s happening right now:
image

Analytics

Another great resource of Application Insights is the Analytics portal, which provides you the ability to write your own custom queries.
image

Alerts

The previous two options are great to see what is happening or what happened historically, but Alerts will tell you what’s happening. I suggest you checkout Alerts from the Application Insights blade, where you can define alerts based on a wide array of metrics.

image

Summary

You can now add Application Insights to your Azure Functions with minimal effort, which is a powerful tool for monitoring your applications. Keep in mind that this is currently only available in the “beta” version of Azure Functions, but is something that should be coming to the production release in the near future now that it’s been merged into the develop branch on github.

Enjoy!

References

Azure Functions integration with Application Insights

Azure Functions now has direct integration with Application Insights

Application Insights

Live Metrics Stream docs

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

toon vanhoutte

Blogging about connecting devices, systems and people! On-premises and in the cloud. Microsoft stack only.

Ken Cenerelli

My life in software development

scomfaq.wordpress.com/

Things about System Center and Cloud...

Build HoloLens

All about HoloLens

DevDays®

For web designers and cloud developers

Build Azure

All about the Microsoft Cloud

vishal patel

Software Developer, Windows 8 and Windows Phone Enthusiast

SQL with Manoj

SQL Server (TSQL) Programming, DB concepts, Tips & Tricks with >400 articles... comments welcome!!!

dragablz.wordpress.com/

Dragable, tearable, dockable WPF TabControl. Open source to boot.

Adrian Hall

Because Developers are Awesome

Ratish Philip's Blog

Another adventure in code...

codematrix

Application Architecture at it's best

One Unicorn

Thoughts from one member of the Entity Framework team...

Rachel Lim's Blog

Simplifying programming into something I can understand

.NET Developer's Blog

Software Development, Flying and Life

The Flying Maverick

Software Development, Flying and Life

Hiking Photography

Beautiful photos of hiking and other outdoor adventures.

paint.net blog

The best free image and photo editor. By Rick Brewster.

Learning by Shipping

products, development, management...

%d bloggers like this: