Skip to content

Commit c2020d4

Browse files
committed
undo
1 parent d162925 commit c2020d4

File tree

6 files changed

+38
-34
lines changed

6 files changed

+38
-34
lines changed

DotNetWorker.Samples.sln

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIntegration", "sample
2626
EndProject
2727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Net9FunctionApp", "samples\Net9FunctionApp\Net9FunctionApp.csproj", "{F7F70331-CB38-47D7-9366-F8C5D934D088}"
2828
EndProject
29+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.Http.AspNetCore", "extensions\Worker.Extensions.Http.AspNetCore\src\Worker.Extensions.Http.AspNetCore.csproj", "{4069A8AC-CB33-4C30-8123-520C6A4A6118}"
30+
EndProject
31+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetWorker", "src\DotNetWorker\DotNetWorker.csproj", "{58F2A5F2-B0FA-427C-A592-F9D0EF8F65E3}"
32+
EndProject
2933
Global
3034
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3135
Debug|Any CPU = Debug|Any CPU
@@ -64,6 +68,14 @@ Global
6468
{F7F70331-CB38-47D7-9366-F8C5D934D088}.Debug|Any CPU.Build.0 = Debug|Any CPU
6569
{F7F70331-CB38-47D7-9366-F8C5D934D088}.Release|Any CPU.ActiveCfg = Release|Any CPU
6670
{F7F70331-CB38-47D7-9366-F8C5D934D088}.Release|Any CPU.Build.0 = Release|Any CPU
71+
{4069A8AC-CB33-4C30-8123-520C6A4A6118}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
72+
{4069A8AC-CB33-4C30-8123-520C6A4A6118}.Debug|Any CPU.Build.0 = Debug|Any CPU
73+
{4069A8AC-CB33-4C30-8123-520C6A4A6118}.Release|Any CPU.ActiveCfg = Release|Any CPU
74+
{4069A8AC-CB33-4C30-8123-520C6A4A6118}.Release|Any CPU.Build.0 = Release|Any CPU
75+
{58F2A5F2-B0FA-427C-A592-F9D0EF8F65E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
76+
{58F2A5F2-B0FA-427C-A592-F9D0EF8F65E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
77+
{58F2A5F2-B0FA-427C-A592-F9D0EF8F65E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
78+
{58F2A5F2-B0FA-427C-A592-F9D0EF8F65E3}.Release|Any CPU.Build.0 = Release|Any CPU
6779
EndGlobalSection
6880
GlobalSection(SolutionProperties) = preSolution
6981
HideSolutionNode = FALSE

NuGet.Config

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
<clear />
55
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
66
<add key="AzureFunctionsTempStaging" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctionsTempStaging/nuget/v3/index.json" />
7-
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
8-
<add key="AzureFunctions" value="https://azfunc.pkgs.visualstudio.com/e6a70c92-4128-439f-8012-382fe78d6396/_packaging/AzureFunctions/nuget/v3/index.json" />
7+
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"/>
98
</packageSources>
109
</configuration>

build/DotNetWorker.Core.slnf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"solution": {
33
"path": "..\\DotNetWorker.sln",
44
"projects": [
5+
"extensions\\Worker.Extensions.Http.AspNetCore\\src\\Worker.Extensions.Http.AspNetCore.csproj",
56
"sdk\\Sdk.Analyzers\\Sdk.Analyzers.csproj",
67
"sdk\\Sdk.Generators\\Sdk.Generators.csproj",
78
"sdk\\Sdk\\Sdk.csproj",
89
"src\\DotNetWorker.ApplicationInsights\\DotNetWorker.ApplicationInsights.csproj",
910
"src\\DotNetWorker.Core\\DotNetWorker.Core.csproj",
1011
"src\\DotNetWorker.Grpc\\DotNetWorker.Grpc.csproj",
11-
"src\\DotNetWorker\\DotNetWorker.csproj",
12-
"src\\DotNetWorker.OpenTelemetry\\DotNetWorker.OpenTelemetry.csproj"
12+
"src\\DotNetWorker.OpenTelemetry\\DotNetWorker.OpenTelemetry.csproj",
13+
"src\\DotNetWorker\\DotNetWorker.csproj"
1314
]
1415
}
1516
}

samples/AspNetIntegration/AspNetIntegration.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
12-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Abstractions" Version="1.3.0" />
13-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http" Version="3.2.0" />
1412
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Storage" Version="6.6.0" />
15-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
16-
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
13+
<!--<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0-preview3" />-->
14+
</ItemGroup>
15+
16+
<ItemGroup>
17+
<ProjectReference Include="..\..\extensions\Worker.Extensions.Http.AspNetCore\src\Worker.Extensions.Http.AspNetCore.csproj" />
1718
</ItemGroup>
1819

1920
<ItemGroup>
Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,14 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license informations
33

4-
#define ENABLE_MIDDLEWARE
5-
6-
using AspNetIntegration;
4+
using Microsoft.Azure.Functions.Worker.Builder;
75
using Microsoft.Extensions.Hosting;
86

9-
#if ENABLE_MIDDLEWARE
10-
var host = new HostBuilder()
11-
.ConfigureFunctionsWebApplication(builder =>
12-
{
13-
// can still register middleware and use this extension method the same way
14-
// .ConfigureFunctionsWorkerDefaults() is used
15-
builder.UseWhen<RoutingMiddleware>((context)=>
16-
{
17-
// We want to use this middleware only for http trigger invocations.
18-
return context.FunctionDefinition.InputBindings.Values
19-
.First(a => a.Type.EndsWith("Trigger")).Type == "httpTrigger";
20-
});
21-
})
22-
.Build();
23-
host.Run();
24-
#else
25-
//<docsnippet_aspnet_registration>
26-
var host = new HostBuilder()
27-
.ConfigureFunctionsWebApplication()
28-
.Build();
7+
var funcBuilder = FunctionsApplication.CreateBuilder(args);
8+
funcBuilder.ConfigureFunctionsWebApplication();
9+
10+
//funcBuilder.Services.AddApplicationInsightsTelemetryWorkerService();
11+
//funcBuilder.Services.ConfigureFunctionsApplicationInsights();
2912

30-
host.Run();
31-
//</docsnippet_aspnet_registration>
32-
#endif
13+
var app = funcBuilder.Build();
14+
app.Run();

samples/AspNetIntegration/SimpleHttpTrigger/SimpleHttpTrigger.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,24 @@
55
using Microsoft.AspNetCore.Mvc;
66
using Microsoft.Azure.Functions.Worker;
77
using Microsoft.Azure.Functions.Worker.Http;
8+
using Microsoft.Extensions.Logging;
89

910
namespace AspNetIntegration
1011
{
1112
public class SimpleHttpTrigger
1213
{
14+
private readonly ILogger<SimpleHttpTrigger> _logger;
15+
16+
public SimpleHttpTrigger(ILogger<SimpleHttpTrigger> logger)
17+
{
18+
_logger = logger;
19+
}
20+
1321
//<docsnippet_aspnet_http_trigger>
1422
[Function("SimpleHttpTrigger")]
1523
public IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequest req)
1624
{
25+
_logger.LogInformation("C# HTTP trigger function processed a request.");
1726
return new OkObjectResult("Welcome to Azure Functions!");
1827
}
1928
//</docsnippet_aspnet_http_trigger>

0 commit comments

Comments
 (0)