Skip to content

Commit

Permalink
updating nugets; using new ISdkVersionProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
brettsam committed Nov 16, 2018
1 parent 4a2ee70 commit 32346dd
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj
Expand Up @@ -53,8 +53,8 @@
<PackageReference Include="Microsoft.AspNetCore.Buffering" Version="0.4.0-preview2-28189" />
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.6740001-e47e0369" />
<PackageReference Include="Microsoft.AspNetCore.Server.IIS" Version="2.1.0-a-oob-2-1-oob-17297" />
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="3.0.3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging" Version="3.0.3" />
<PackageReference Include="Microsoft.Azure.WebSites.DataProtection" Version="2.1.88-alpha" />
<PackageReference Include="System.Net.Primitives" Version="4.3.0" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.1" />
Expand Down
@@ -0,0 +1,15 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure.WebJobs.Logging.ApplicationInsights;

namespace Microsoft.Azure.WebJobs.Script.Diagnostics
{
internal class ApplicationInsightsSdkVersionProvider : ISdkVersionProvider
{
public string GetSdkVersion()
{
return $"azurefunctions: {ScriptHost.Version}";
}
}
}
6 changes: 5 additions & 1 deletion src/WebJobs.Script/ScriptHostBuilderExtensions.cs
Expand Up @@ -8,6 +8,7 @@
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.Azure.WebJobs.Host.Executors;
using Microsoft.Azure.WebJobs.Logging;
using Microsoft.Azure.WebJobs.Logging.ApplicationInsights;
using Microsoft.Azure.WebJobs.Script.Binding;
using Microsoft.Azure.WebJobs.Script.BindingExtensions;
using Microsoft.Azure.WebJobs.Script.Config;
Expand Down Expand Up @@ -219,13 +220,16 @@ internal static void ConfigureApplicationInsights(HostBuilderContext context, IL
builder.AddApplicationInsights(o => o.InstrumentationKey = appInsightsKey);
builder.Services.ConfigureOptions<ApplicationInsightsLoggerOptionsSetup>();

builder.Services.AddSingleton<ISdkVersionProvider, ApplicationInsightsSdkVersionProvider>();

// Override the default SdkVersion with the functions key
builder.Services.AddSingleton<TelemetryClient>(provider =>
{
TelemetryConfiguration configuration = provider.GetService<TelemetryConfiguration>();
TelemetryClient client = new TelemetryClient(configuration);
client.Context.GetInternalContext().SdkVersion = $"azurefunctions: {ScriptHost.Version}";
ISdkVersionProvider versionProvider = provider.GetService<ISdkVersionProvider>();
client.Context.GetInternalContext().SdkVersion = versionProvider.GetSdkVersion();
return client;
});
Expand Down
4 changes: 2 additions & 2 deletions src/WebJobs.Script/WebJobs.Script.csproj
Expand Up @@ -37,10 +37,10 @@
<PackageReference Include="Microsoft.Azure.AppService.Proxy.Client" Version="2.0.6740001-e47e0369" />
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.2.2" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Http" Version="3.0.0-10697" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.WebJobs.Logging.ApplicationInsights" Version="3.0.3" />
<PackageReference Include="Microsoft.Build" Version="15.8.166" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.8.2" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="2.1.0" />
Expand Down
Expand Up @@ -38,7 +38,7 @@
<PackageReference Include="Microsoft.Azure.DocumentDB.Core" Version="2.1.2" />
<PackageReference Include="Microsoft.Azure.EventHubs" Version="2.1.0" />
<PackageReference Include="Microsoft.Azure.Functions.NodeJsWorker" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.2" />
<PackageReference Include="Microsoft.Azure.Functions.JavaWorker" Version="1.2.2" />
<PackageReference Include="Microsoft.Azure.Mobile.Client" Version="4.0.2" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="3.1.0" />
Expand Down
2 changes: 1 addition & 1 deletion test/WebJobs.Script.Tests/WebJobs.Script.Tests.csproj
Expand Up @@ -52,7 +52,7 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="Moq" Version="4.9.0" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.0-beta004" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.2" />
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="2.1.0.227">
</PackageReference>
<PackageReference Include="xunit" Version="2.4.0" />
Expand Down

0 comments on commit 32346dd

Please sign in to comment.