Skip to main content Explore View all products (200+) Microsoft Foundry Azure Copilot GitHub Copilot Azure Kubernetes Service (AKS) Azure Cosmos DB Azure Database for PostgreSQL Azure Arc Microsoft Fabric Linux virtual machines in Azure Foundry Models Foundry Agent Service Foundry IQ Foundry Tools Foundry Control Plane Observability in Foundry Control Plane Azure OpenAI in Foundry Models Azure Speech in Foundry Tools Azure Machine Learning View all databases Azure Cosmos DB Azure DocumentDB Azure SQL Azure Database for PostgreSQL Azure Managed Redis Microsoft Fabric Azure Databricks Linux virtual machines in Azure Windows Server on Azure Azure Functions Azure Virtual Machine Scale Sets Azure API Management Azure Container Apps Azure Kubernetes Service (AKS) Azure Kubernetes Fleet Manager Azure Container Registry Azure Red Hat OpenShift Azure Container Instances Azure Container Storage Azure Arc Azure Local Microsoft Defender for Cloud Azure Monitor Microsoft Sentinel Azure Migrate View all solutions (40+) Cloud solutions for small and medium businesses Cloud migration and modernization center Data analytics for AI Azure Databases AI apps and agents Microsoft Marketplace Microsoft Sovereign Cloud AI apps and agents Responsible AI with Azure AI Infrastructure Data analytics for AI Machine learning operations (MLOps) Low-code application development on Azure Integration Services Serverless computing DevOps Migration and modernization center .NET apps migration Databases on Azure Linux on Azure Oracle on Azure SAP on the Microsoft Cloud Adaptive cloud High-performance computing (HPC) Infrastructure as a service (IaaS) Resiliency Azure Essentials Frontier Accelerate for Azure FinOps on Azure Microsoft Marketplace Azure pricing overview Create an Azure account Free Azure services Flexible purchase options Pricing calculator FinOps on Azure Maximize ROI from AI Azure savings plans Azure reservations Azure Hybrid Benefit Virtual Machines Azure SQL Microsoft Foundry Microsoft Fabric Azure Kubernetes Service (AKS) Microsoft Defender for Cloud View more Software Development Companies Microsoft Marketplace Find a partner Resources for Azure partners Get started with Azure Customer stories Analyst reports, white papers, and e-books Videos Learn more about cloud computing Documentation Explore Azure portal Developer resources Quickstart templates Resources for startups Developer community Students Azure for partners Blog Events and Webinars Learn Support Contact Sales Get started with Azure Sign in

We released a new Application Insights Labs SDK specifically for monitoring WCF applications. Although Application Insights SDK for .NET Web Applications already supports HTTP-based WCF applications, it has never been optimized for WCF specifics. The Application Insights WCF SDK makes a great experience for monitoring those applications. It monitors all common WCF bindings, and provides exception monitoring, clear identification of operations, and selective monitoring.

Motivation

Writing monitoring tools, you always have a choice of many layers from which you can collect telemetry. The common denominator for many IIS based applications is the HTTP modules layer. The HTTP module receives notifications about every HTTP request, no matter what technology is used to process this request – ASP.NET, MVC, Web API or WCF. It can even monitor non-.NET applications.

We heard a lot of feedback that the generic approach is not quite working for WCF applications. This feedback was so strong that one of Application Insights fan and big supporter, Tomas Restrepo, decided to build WCF monitoring support for himself. He missed several experiences that were not supported in the web SDK and also wanted to remove some limitations.

Now we are sharing the result of Tomas’s work: Application Insights SDK for WCF applications.

Features

The Application Insights SDK for WCF applications provides a list of exciting features.

Instrumentation with any common WCF bindings

The limitation of only HTTP bindings is now removed with the Application Insights SDK for WCF telemetry. Now you can use any of the common WCF bindings, HTTP-based or not!

Mapping operations

Now you are able to differentiate requests for a specific service operation without custom code. Instead of a generic url path, operation names for request telemetry are in the form, .., so you can map operations more easily to your code.

IErrorHandler extensibility point

With IErrorHandler implemented you can automatically track exceptions or faults thrown by the service in most scenarios.

Selective monitoring

By default, calls to any WCF service will send a request event to Application Insights.

To select services for monitoring, attach the [OperationTelemetry] method attribute to the contracts or implementations of the services you want to be monitored. If you use this attribute anywhere in your app, services that don’t have the attribute will not be monitored.

Installation

Add to your WCF project the prerelease Microsoft.ApplicationInsights.Wcf package from the Application Insights SDK Labs package source.

If you’re using the command line NuGet package manager:

> Install-Package "Microsoft.ApplicationInsights.Wcf" –Source "https://www.myget.org/F/applicationinsights-sdk-labs/" -Pre

If you’re using Visual Studio:

In Solution Explorer, right-click your project and choose Manage NuGet Packages. Then add https://www.myget.org/F/applicationinsights-sdk-labs/ to the package sources list.

wcf_thumb1

Set the package source, check Include prerelease and install Microsoft.ApplicationInsights.Wcf.

wcf2_thumb1

Set the instrumentation key

Add the instrumentation key of your Application Insights resource to the ApplicationInsights.config file. You can also provide the instrumentation key through code or web config. That’s it!

Special thanks

We want to thank Tomas Restrepo for sharing Application Insights SDK for WCF applications with us and the community.

Please let us know…

For any issues or feature requests please visit the Application Insights SDK for WCF Telemetry repository.

We would love to hear your thoughts and opinions comparing the WCF-specific SDK versus the generic Web SDK. The Application Insights team is committed to providing quality tools for developers. We would greatly appreciate any feedback or new feature recommendations.

WE ARE MICROSOFT

Explore Microsoft Foundry

The future of AI starts here. Envision your next great AI app with the latest technologies. Get started with Azure.