Azure Application Insights (AI) is a great instrumentation tool that can help you learn about how your application is doing during run-time. It is currently in Preview mode, so bear that in mind when developing production ready apps. It gives you the ability to log lots of different kinds of information like tracing, page views, custom events, metrics and more.

Azure AI supports multiple platforms, but unfortunately they have not released a Xamarin package yet. There is one library which is for Xamarin.Forms since it uses the DependencyResolver. I have taken that and removed that dependency to make it compatible with Xamarin.iOS. You could do the same thing to use it for Xamarin.Android too if you like.

It’s very simple to use, all you need is your instrumentationkey which you can get from your Azure portal. Follow the steps from the MSDN tutorial as you can see here to create the Azure AI instance and get your key. Once done, you could download and reference the repository that I have created on GitHub, as you can find it here.

To start Azure AI on your Xamarin iOS app, you could do:

[code lang=”csharp”]





The implementation of the AzureAIManager is as follows:

[code lang=”csharp”]

public static class AzureAIManager
public static void Setup(string appKey = "your-azure-AI-instrumentation-key")

var ai = new AI.Xamarin.iOS.ApplicationInsights ();
ApplicationInsights.Init (ai);

TelemetryManager.Init(new AI.Xamarin.iOS.TelemetryManager());


public static void Start()

public static void Configure(string userId = "" )

if (string.IsNullOrEmpty(userId))

public static void RenewSession()


I have not put this as a Nuget package because I am sure Microsoft will release one very soon, so until that happens, you can use this bindings to play around with Azure AI and you could even use it on your small projects.

Application Development and Integration, Azure Platform, Mobile
, , , , , , ,

Join the conversation! 4 Comments

  1. “I have taken that and removed that dependency to make it compatible with Xamarin.iOS”
    How did you remove that dependecy?


Leave a Reply