Skip to content

Commit eda8870

Browse files
authored
Support Azure Functions v4 (#11)
* Support Azure Functions v4 * Use .NET SDK pre-release version * Update Function SDK v4 * Update NuGet metadata * Make multi-targeting package * Fixed dotnet-format dry-run option name * Update Azure Functions SDK v4.0 GA * Update package metadata * Adding no restore option
1 parent c5f711f commit eda8870

File tree

6 files changed

+30
-18
lines changed

6 files changed

+30
-18
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,31 @@ on:
77
branches: [ master ]
88

99
env:
10-
DOTNET_VERSION: 3.1.x
10+
DOTNET_VERSION: 6.0.x
11+
DOTNETCORE_VERSION: 3.1.x
1112

1213
jobs:
1314
build:
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v2
1718

18-
- name: Use .NET Core ${{ env.DOTNET_VERSION }}
19+
- name: Use .NET ${{ env.DOTNET_VERSION }}
1920
uses: actions/setup-dotnet@v1
2021
with:
2122
dotnet-version: ${{ env.DOTNET_VERSION }}
23+
include-prerelease: true
2224

23-
- name: Install .NET Core format tool
25+
- name: Use .NET Core ${{ env.DOTNETCORE_VERSION }}
26+
uses: actions/setup-dotnet@v1
27+
with:
28+
dotnet-version: ${{ env.DOTNETCORE_VERSION }}
29+
30+
- name: Install .NET format tool
2431
run: dotnet tool update -g dotnet-format
2532

2633
- name: Build project
2734
run: dotnet build -c Release
2835

2936
- name: Lint C# code
30-
run: dotnet format --check --verbosity detailed
37+
run: dotnet format --verify-no-changes --verbosity detailed --no-restore

.github/workflows/publish.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@ on:
55
tags: [ v* ]
66

77
env:
8-
DOTNET_VERSION: 3.1.x
8+
DOTNET_VERSION: 6.0.x
9+
DOTNETCORE_VERSION: 3.1.x
910

1011
jobs:
1112
publish:
1213
runs-on: ubuntu-latest
1314
steps:
1415
- uses: actions/checkout@v2
1516

16-
- name: Use .NET Core ${{ env.DOTNET_VERSION }}
17+
- name: Use .NET ${{ env.DOTNET_VERSION }}
1718
uses: actions/setup-dotnet@v1
1819
with:
1920
dotnet-version: ${{ env.DOTNET_VERSION }}
21+
include-prerelease: true
22+
23+
- name: Use .NET Core ${{ env.DOTNETCORE_VERSION }}
24+
uses: actions/setup-dotnet@v1
25+
with:
26+
dotnet-version: ${{ env.DOTNETCORE_VERSION }}
2027

2128
- name: Setup Version
2229
id: setup_version

samples/BasicSample/BasicSample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
4-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\Azure.WebJobs.Extensions.HttpApi\Azure.WebJobs.Extensions.HttpApi.csproj" />

samples/VirtualPathSample/VirtualPathSample.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp3.1</TargetFramework>
4-
<AzureFunctionsVersion>v3</AzureFunctionsVersion>
3+
<TargetFramework>net6.0</TargetFramework>
4+
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
55
</PropertyGroup>
66
<ItemGroup>
7-
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.13" />
7+
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.0" />
88
</ItemGroup>
99
<ItemGroup>
1010
<ProjectReference Include="..\..\src\Azure.WebJobs.Extensions.HttpApi\Azure.WebJobs.Extensions.HttpApi.csproj" />

src/Azure.WebJobs.Extensions.HttpApi/Azure.WebJobs.Extensions.HttpApi.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp3.1</TargetFramework>
4+
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks>
55
</PropertyGroup>
66

77
<PropertyGroup>
88
<Authors>shibayan</Authors>
9+
<Description>HTTP API Extensions for Azure Functions</Description>
910
<PackageId>WebJobs.Extensions.HttpApi</PackageId>
10-
<Description>HTTP API Extensions for Azure Functions v3</Description>
1111
<PackageReadmeFile>README.md</PackageReadmeFile>
1212
<PackageReleaseNotes>https://github.com/shibayan/azure-functions-http-api/releases</PackageReleaseNotes>
1313
<PackageLicenseExpression>MIT</PackageLicenseExpression>

src/Azure.WebJobs.Extensions.HttpApi/FunctionEnvironment.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ namespace Azure.WebJobs.Extensions.HttpApi
44
{
55
internal static class FunctionEnvironment
66
{
7-
public static bool IsAvailable
8-
=> !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME"));
7+
public static bool IsAvailable => !string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WEBSITE_SITE_NAME"));
98

10-
public static string RootPath
11-
=> IsAvailable ? Environment.ExpandEnvironmentVariables($"%HOME%/site/wwwroot") : Environment.CurrentDirectory;
9+
public static string RootPath => IsAvailable ? Environment.ExpandEnvironmentVariables($"%HOME%/site/wwwroot") : Environment.CurrentDirectory;
1210
}
1311
}

0 commit comments

Comments
 (0)