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:




The implementation of the AzureAIManager is as follows:

	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. […] Azure ApplicationsInsights for Xamarin iOS […]

  2. […] Azure ApplicationsInsights for Xamarin iOS Has Altaiar, from, shows off the new Azure Application Insights for Xamarin.Forms. […]

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


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: