Christian
Christian

Reputation: 10164

In Application Insights dependency tracking, how to set Dependency Type and Result Code?

When tracking dependencies with Application Insights, in Azure Portal these events contain properties Dependency Type and Result code that are unset.

Dependency Properties in Microsoft Azure

How to track dependencies so that properties Dependency type and Result code are set?

Upvotes: 1

Views: 2258

Answers (1)

Alex Bulankou
Alex Bulankou

Reputation: 2456

Please upgrade to use the latest prerelease .NET SDK Nuget: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Web/2.0.0-rc1

Just tried a simple example:

DependencyTelemetry dep = new DependencyTelemetry("DepName", "CommandName", DateTimeOffset.Now.AddSeconds(-1), TimeSpan.FromSeconds(1), true);
dep.DependencyTypeName = "MyTypeName";
dep.ResultCode = "200";

new TelemetryClient(new TelemetryConfiguration()
{
                InstrumentationKey = "ikey",
                TelemetryChannel = new InMemoryChannel()
 }).TrackDependency(dep);

and I can see ResultCode and Type: enter image description here

Upvotes: 3

Related Questions