introduction à application insights

29
Application Insights

Upload: msdevmtl

Post on 15-Apr-2017

323 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introduction à Application Insights

Application Insights

Page 2: Introduction à Application Insights

This is NOT…

• A presentation on the best practices for AI• A deep dive!• A perfect tool• And I’m not a sales person, just showing AI!

Page 3: Introduction à Application Insights

Agenda

• What’s Application Insights?• What can you do with AI? • What’s a subscription to Azure?• How can I add AI to my subscription?• What are the AI pricing tiers?• Where do I start?

Page 4: Introduction à Application Insights

Agenda

• Managing access to your AI• Manually instrument an application (API)• Automatically instrument an application• Read the data from Application Insights• Analytics!• Questions?• Documentation

Page 5: Introduction à Application Insights

What’s Application Insights

• Application Performance Monitoring tool• It aggregates data that you send from your app• It displays those data in a web portal• Has an API to manually instrument your apps• “Baked in” functionalities (ASP.NET, SQL, Java…)• Integrated with VS2013 or more• API can be used with VS2012+ (Fx 4.5)• Part of the Microsoft Azure offering

Page 6: Introduction à Application Insights

What can you do with AI?

• Report usage of features in your application• Report bugs• Availability and performance monitoring • Page views stats• Support Java, mobile or client apps, JavaScript• Dive into the reported data with the “Analytics”

query language!• Auto-magically transfer data to your own SQL

Server database!

Page 7: Introduction à Application Insights

What can you do with AI?

• Instrument your various apps:

Page 8: Introduction à Application Insights

What can you do with AI?

• Mobile apps should be instrumented with…

Page 9: Introduction à Application Insights

What’s a subscription to Azure?

• Requires a Microsoft account to create a sub• TIP : Create a « Billing Account »… why?• A subscription is an application container• Add or remove Azure (apps or service) to subs• A subscription is your portfolio of billable items• A subscription can contain non billable apps• To create a subscription, go to :www.microsoftazure.com

Page 10: Introduction à Application Insights

What’s a subscription to Azure?

Page 11: Introduction à Application Insights

What’s a subscription to Azure?

Page 12: Introduction à Application Insights

What’s a subscription to Azure?

• Eventually you’ll be redirected to : www.portal.azure.com

• This is your azure dashboard or portal• This is where you add apps to your sub…

Page 13: Introduction à Application Insights

How can I add AI to my subscription?

• On the Azure Portal, go to “New” then scroll down to “Developer Services” and choose “Application Insights”.

Page 14: Introduction à Application Insights

How can I add AI to my subscription?

• Choose a name for your app• Choose an “Application type” like “ASP.NET”• Select the subscription to be used for billing• Select a “Resource Group” for the app…

Page 15: Introduction à Application Insights

[…Ressource Groups…]

• …a resource group is just a group of apps or services under Azure. The group helps those components communicate between each others and can be managed together under the group… Chances are you’ll never use that!

Page 16: Introduction à Application Insights

How can I add AI to my subscription?

• And finally, the only location available is “Central US”

• Then… hit “Create” and enjoy…

Page 17: Introduction à Application Insights

Wait a minute…

• I told you where to bill me (subscription)…• …but I haven’t choose a pricing tier yet…• …MS wouldn’t bill me without letting me

choose a pricing tier, right…. RIGHT???• … of course not… All new AI apps use the FREE

pricing tier… Change it in the properties of your AI app.

Page 18: Introduction à Application Insights

What are the AI pricing tiers?

Page 19: Introduction à Application Insights

Where do I start?

• Understand the navigation in the Azure portal• Get your Instrumentation Key• Learn the API• Log data to see what can be displayed and how• Customize and save few searches with

predefined filters• If you define custom properties, use enums, max

200 different names…

Page 20: Introduction à Application Insights

Managing access to your AI

• You invite people in…• … but it’s a Microsoft Account only club • You choose their role upon inviting them• Let’s do this!

Click Subscriptions -> click your sub -> Settings -> Users ->Add -> Select a Role (contrib) -> Add users -> Search existing users or click Invite to invite a new user.

• This will adds the user to your allowed users in your “Default Directory”.

Page 21: Introduction à Application Insights

Managing access to your AI

• When the user logs in he has to look into YOUR default directory, not his… ! (??????)

Page 22: Introduction à Application Insights

Manually instrument an App (API)

• Add a reference to : Microsoft.ApplicationInsights.dll• Set your Instrumentation Key• Declare a variable of type TelemetryClient• Use one of the variable’s « Track » method :

– TrackDependency - TrackEvents– TrackException - TrackMetric– TrackPageView - TrackRequest– TrackTrace

• Use the Flush method on the variable to ensure data is sent and not buffered.

Page 23: Introduction à Application Insights

Manually instrument an App (API)

• Demo

Page 24: Introduction à Application Insights

Automatically instrument an App

• Use VS2013 or VS2015

Page 25: Introduction à Application Insights

Automatically instrument an App

• Follow the sign-in instructions and select the right Application Insight ressource (target)

• Validate that the app.config file contains the right Instrumentation key

• Fire your app !

Page 26: Introduction à Application Insights

Read data from Application Insights

• Demo– Included properties– Custom Properties– Search by session– Search by property values

Page 27: Introduction à Application Insights

Analytics

• Not another query language come on MS ???• We had T-SQL, LinQ, DMX, Xpath… now this…• Demo

Page 28: Introduction à Application Insights

Questions?

Page 29: Introduction à Application Insights

Documentation

• Alan Cameron Wills Application Insights