Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Application Insight to a existing Azure Service Fabric cluster

We have been working on Azure Service Fabric since last 4 months but now have decided to have a unified loging infrastructure for which we are using AppInsight, how can we add a AppInsight Key to a existing Service Fabric cluster

like image 549
akhil Avatar asked May 17 '17 07:05

akhil


People also ask

How do you integrate application Insights in Azure?

In your function app, select Configuration under Settings, and then select Application settings. If you see a setting named APPINSIGHTS_INSTRUMENTATIONKEY , Application Insights integration is enabled for your function app running in Azure.

How do I add application Insights to an existing project in .NET core?

Go to Project > Add Application Insights Telemetry. Choose Azure Application Insights, then select Next. Choose your subscription and Application Insights instance (or create a new instance with Create new), then select Next.

How do I manage a service fabric cluster?

A Service Fabric cluster offers several entry points to its management functionality, including the web-based Service Fabric Explorer and Visual Studio. As a result, you will create two Azure AD applications to control access to the cluster: one web application and one native application.

How do I add service fabric explorer to my Azure AD app?

On the Azure AD app registration page for your cluster, select Authentication, and under the Redirect URIs section, add the Service Fabric Explorer URL to the list. Save your change.

How do I use application insights with service fabric?

Application Insights has a rich out of the box experience when using Service Fabric. In the overview page, Application Insights provides key information about your service such as the response time and number of requests processed. By clicking the 'Search' button at the top, you can see a list of recent requests in your application.

How to integrate application insights into Azure function?

We can integrate application insights into Azure function in multiple ways as below, Log in to the Azure portal. In the Search bar, search as "function app" and then select the Function app. Once we filled out basic details, then click on the Next: Hosting button.


2 Answers

I did it this way, using Visual Studio 2017:

  1. Open Cloud Explorer from VS
  2. Expand Virtual Machine Scale Sets
  3. Locate the scale set containing your SF cluster.
  4. Right-click Update diagnostics...
  5. In the dialog, check Send diagnostics to Application Insights and add the Instrumentation key for you AI sink
  6. Click OK and leave the dialogue
  7. You might get an error (I did), but if you re-open the dialog you will find that the settings are still there.
  8. To 'apply' the new settings to the cluster, open your azure portal, select All resources, and open the Virtual Machine Scale Set
  9. At this point, hopefully selecting Restart will apply the changes to the cluster. I did a Deallocate followed by a Restart and a re-deploy of my SF-application, and this worked (I did not test if just doing a restart would work). However be very careful using this approach, make sure you know the trade-offs when de-allocation a SF-cluster
like image 192
Rasmus Avatar answered Oct 18 '22 18:10

Rasmus


Unfortunately it is not just that simple right now.

The Application Insights support as shown at Build 2017 is still in preview. It consists of two nuget preview packages you have to install and you need to update your cluster to the latest version. Stay tuned to this repo which at the moment shows

Using Service Fabric with Application Insights

We are working on updating this repo to demonstrate how to use Service Fabric with Application Insights. The completed repo is not quite ready, please check back here within the next couple of days!

More information about the setup and nuget packages can be found here:

This repository produces the following two nuget packages:

Microsoft.ApplicationInsights.ServiceFabric.Native - For use with Service Fabric's native reliable services. Microsoft.ApplicationInsights.ServiceFabric - For use with Guest Executable and Guest container services (lift and shift scenarios).

Until that time you can take a look at this repo for full (manual) Application Insights integration.

like image 36
Peter Bons Avatar answered Oct 18 '22 18:10

Peter Bons