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
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.
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.
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.
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.
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.
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.
I did it this way, using Visual Studio 2017:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With