gpt4 book ai didi

azure - Azure Functions 使用 ASP.NET 的哪些部分?

转载 作者:行者123 更新时间:2023-12-02 23:18:32 26 4
gpt4 key购买 nike

Azure Functions 使用 ASP.NET(Core?)中的 HttpResultIActionResult 类来处理 HTTP 触发器。用于 Azure Functions v2 运行时的 ASP.NET 版本是什么?我知道 v2 使用在 .NET Core 上运行的 .NET Standard 2.0,因此我假设使用 ASP.NET Core,但使用哪个版本?

最佳答案

两个概念,一个是为 Azure Functions 提供支持的主机/运行时。

目前,Azure Function 2.0 运行时基于 .Net Core 2.1和引用文献Microsoft.AspNetCore.App v2.1.6

另一个是 Azure WebJobs SDK,该框架简化了编写在 Azure Function 运行时上运行的代码的任务。我们可以使用 HttpResultIActionResult 因为 SDK 引用 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" />

我们的 Function 项目可以定位于 netcoreapp2.1netstandard2.0。要使用 .Net Core API,请使用 netcoreapp2.1

关于azure - Azure Functions 使用 ASP.NET 的哪些部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53737308/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com