Reputation: 10164
When tracking dependencies with Application Insights, in Azure Portal these events contain properties Dependency Type and Result code that are unset.
How to track dependencies so that properties Dependency type and Result code are set?
Upvotes: 1
Views: 2258
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:
Upvotes: 3