Azure Functions uses the HttpResult
and IActionResult
classes from ASP.NET (Core?) to handle HTTP triggers. What version of ASP.NET is this for the Azure Functions v2 Runtime? I know that v2 uses .NET Standard 2.0 running on .NET Core, so I'm assuming ASP.NET Core is used, but which version?
Two concepts, one is the host/runtime that powers Azure Functions.
Right now, Azure Function 2.0 runtime is based on .Net Core 2.1, and references Microsoft.AspNetCore.App v2.1.6.
Another is the Azure WebJobs SDK, the framework that simplifies the task of writing code to run on Azure Function runtime. We can use HttpResult
and IActionResult
because the SDK references ASP.NET(Core) packages.
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.4" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.0" />
And our Function project can target at netcoreapp2.1
or netstandard2.0
. To consume .Net Core APIs, use netcoreapp2.1
.