Azure Functions 中支持的语言Supported languages in Azure Functions

本文介绍为可用于 Azure Functions 的语言提供的支持级别。This article explains the levels of support offered for languages that you can use with Azure Functions. 它还介绍了使用不受本机支持的语言创建函数时可使用的策略。It also describes strategies for creating functions using languages not natively supported.

支持级别Levels of support

有两个级别的支持:There are two levels of support:

  • 正式发布 (GA) - 完全支持并获得批准在生产中使用。Generally available (GA) - Fully supported and approved for production use.
  • 预览 - 尚不支持,但将来应达到 GA 状态。Preview - Not yet supported but is expected to reach GA status in the future.

按运行时版本列出的语言Languages by runtime version

三个版本的 Azure Functions 运行时都可用。Three versions of the Azure Functions runtime are available. 下表显示每个运行时版本支持的语言。The following table shows which languages are supported in each runtime version.

语言Language 1.x1.x 2.x2.x 3.x3.x
C#C# GA (.NET Framework 4.7)GA (.NET Framework 4.7) GA (.NET Core 2.2)GA (.NET Core 2.2) GA (.NET Core 3.1)GA (.NET Core 3.1)
JavaScriptJavaScript GA (Node 6)GA (Node 6) GA(Node 10 和 8)GA (Node 10 & 8) GA(Node 12 和 11)GA (Node 12 & 11)
F#F# GA (.NET Framework 4.7)GA (.NET Framework 4.7) GA (.NET Core 2.2)GA (.NET Core 2.2) GA (.NET Core 3.1)GA (.NET Core 3.1)
JavaJava 空值N/A GA (Java 8)GA (Java 8) GA(Java 111 和 8)GA (Java 111 & 8)
PowerShellPowerShell 空值N/A GA (PowerShell Core 6)GA (PowerShell Core 6) GA(PowerShell 7 和 Core 6)GA (PowerShell 7 & Core 6)
TypeScriptTypeScript 不适用N/A 正式版2GA2 正式版2GA2

1 语言版本支持目前处于预览阶段。1 Language version support is currently in preview.
2 转译为 JavaScript 后支持。2 Supported through transpiling to JavaScript.

自定义处理程序(预览版)Custom handlers (preview)

自定义处理程序是可以从 Azure Functions 主机接收事件的轻型 Web 服务器。Custom handlers are lightweight web servers that receive events from the Azure Functions host. 支持 HTTP 基元的任何语言都可以实现自定义处理程序。Any language that supports HTTP primitives can implement a custom handler. 这意味着可以使用自定义处理程序以不受官方支持的语言创建函数。This means that custom handlers can be use to create functions in languages that aren't officially supported. 有关详细信息,请参阅 Azure Functions 自定义处理程序(预览版)To learn more, see Azure Functions custom handlers (preview).

语言扩展性Language extensibility

从版本 2.x 开始,运行时旨在提供语言扩展性Starting with version 2.x, the runtime is designed to offer language extensibility. 2.x 运行时中的 JavaScript 和 Java 语言是使用此扩展性生成的。The JavaScript and Java languages in the 2.x runtime are built with this extensibility.

后续步骤Next steps

若要详细了解如何使用支持的语言开发函数,请参阅以下资源:To learn more about how to develop functions in the supported languages, see the following resources: