Skip to content

Commit 05062aa

Browse files
authored
Upgrade to latest Azure Functions SDK (#41)
1 parent a3e7add commit 05062aa

File tree

11 files changed

+22
-27
lines changed

11 files changed

+22
-27
lines changed

samples/BasicSample/BasicSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\WebJobs.Extensions.HttpApi\WebJobs.Extensions.HttpApi.csproj" />

samples/IsolatedSample/Function1.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ namespace IsolatedSample;
1010
public class Function1(IHttpContextAccessor httpContextAccessor, ILogger<Function1> logger)
1111
: HttpFunctionBase(httpContextAccessor)
1212
{
13-
private readonly ILogger _logger = logger;
14-
1513
[Function("Function1")]
1614
public IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post")] HttpRequest req)
1715
{
18-
_logger.LogInformation("C# HTTP trigger function processed a request.");
16+
logger.LogInformation("C# HTTP trigger function processed a request.");
1917

2018
return Ok($"Welcome to Azure Functions, {req.Query["name"]}!");
2119
}

samples/IsolatedSample/IsolatedSample.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99
<ItemGroup>
10-
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="1.23.0" />
11-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.4" />
10+
<PackageReference Include="Microsoft.Azure.Functions.Worker" Version="2.0.0" />
11+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="2.0.0" />
1212
</ItemGroup>
1313
<ItemGroup>
1414
<ProjectReference Include="..\..\src\Functions.Worker.Extensions.HttpApi\Functions.Worker.Extensions.HttpApi.csproj" />

samples/IsolatedSample/Program.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
using Azure.Functions.Worker.Extensions.HttpApi.Config;
22

3+
using Microsoft.Azure.Functions.Worker.Builder;
34
using Microsoft.Extensions.Hosting;
45

5-
var host = new HostBuilder()
6-
.ConfigureFunctionsWebApplication(workerApplication =>
7-
{
8-
workerApplication.AddHttpApi();
9-
})
10-
.Build();
6+
var builder = FunctionsApplication.CreateBuilder(args);
117

12-
host.Run();
8+
builder.ConfigureFunctionsWebApplication()
9+
.AddHttpApi();
10+
11+
// Application Insights isn't enabled by default. See https://aka.ms/AAt8mw4.
12+
// builder.Services
13+
// .AddApplicationInsightsTelemetryWorkerService()
14+
// .ConfigureFunctionsApplicationInsights();
15+
16+
builder.Build().Run();

samples/ProxySample/ProxySample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\WebJobs.Extensions.HttpApi\WebJobs.Extensions.HttpApi.csproj" />

samples/VirtualPathSample/VirtualPathSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\WebJobs.Extensions.HttpApi\WebJobs.Extensions.HttpApi.csproj" />

samples/WebsiteSample/WebsiteSample.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.4.1" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.6.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\WebJobs.Extensions.HttpApi\WebJobs.Extensions.HttpApi.csproj" />

src/Functions.Worker.Extensions.HttpApi/Config/HttpApiBuilderExtensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public static class HttpApiBuilderExtensions
1212
{
1313
public static IFunctionsWorkerApplicationBuilder AddHttpApi(this IFunctionsWorkerApplicationBuilder builder)
1414
{
15-
if (builder is null)
16-
{
17-
throw new ArgumentNullException(nameof(builder));
18-
}
15+
ArgumentNullException.ThrowIfNull(builder);
1916

2017
builder.Services.AddHttpContextAccessor();
2118
builder.UseMiddleware<HttpContextAccessorMiddleware>();

src/Functions.Worker.Extensions.HttpApi/Functions.Worker.Extensions.HttpApi.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
</ItemGroup>
2323

2424
<ItemGroup>
25-
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="1.3.2" />
25+
<PackageReference Include="Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore" Version="2.0.0" />
2626
</ItemGroup>
2727

2828
<ItemGroup>

src/Functions.Worker.Extensions.HttpApi/HttpFunctionBase.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22

33
namespace Azure.Functions.Worker.Extensions.HttpApi;
44

5-
public class HttpFunctionBase(IHttpContextAccessor httpContextAccessor) : WebJobs.Extensions.HttpApi.Core.HttpFunctionImpl(httpContextAccessor)
6-
{
7-
}
5+
public class HttpFunctionBase(IHttpContextAccessor httpContextAccessor) : WebJobs.Extensions.HttpApi.Core.HttpFunctionImpl(httpContextAccessor);

0 commit comments

Comments
 (0)