Azure Functions 簡介An introduction to Azure Functions

Azure Functions 可讓您執行一小段程式碼 (稱為「函式」),而無須顧慮應用程式基礎結構。Azure Functions allows you to run small pieces of code (called "functions") without worrying about application infrastructure. 透過 Azure Functions,雲端基礎結構可為您提供大規模持續執行應用程式所需的所有最新伺服器。With Azure Functions, the cloud infrastructure provides all the up-to-date servers you need to keep your application running at scale.

函式由特定類型的事件所「觸發」。A function is "triggered" by a specific type of event. 支援的觸發程序包括回應資料的變更、回應訊息、按照排程執行,或作為 HTTP 要求的結果。Supported triggers include responding to changes in data, responding to messages, running on a schedule, or as the result of an HTTP request.

雖然您一律可直接對各式各樣的服務撰寫程式碼,但與其他服務的整合可利用繫結來簡化。While you can always code directly against a myriad of services, integrating with other services is streamlined by using bindings. 繫結可讓您對各種不同的 Azure 和第三方服務進行宣告式存取Bindings give you declarative access to a wide variety of Azure and third-party services.

特性Features

Azure Functions 的主要功能包括︰Some key features of Azure Functions include:

  • 無伺服器應用程式:Functions 可讓您在 Microsoft Azure 上開發無伺服器應用程式。Serverless applications: Functions allow you to develop serverless applications on Microsoft Azure.

  • 語言的選擇:使用您選擇的 C#、Java、JavaScript、Python 和 PowerShell 來撰寫函式。Choice of language: Write functions using your choice of C#, Java, JavaScript, Python, and PowerShell.

  • 按使用次數付費的定價模式:僅針對您執行程式碼所花費的時間付費。Pay-per-use pricing model: Pay only for the time spent running your code. 請參閱價格區段中的使用情況主控方案選項。See the Consumption hosting plan option in the pricing section.

  • 自備相依性:Functions 支援 NuGet 和 NPM,以便您存取慣用的程式庫。Bring your own dependencies: Functions supports NuGet and NPM, giving you access to your favorite libraries.

  • 整合式安全性:利用 OAuth 提供者 (如 Azure Active Directory、Facebook、Google、Twitter 和 Microsoft 帳戶) 保護 HTTP 觸發的函式。Integrated security: Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account.

  • 簡化的整合:輕易與 Azure 服務和軟體即服務 (SaaS) 供應項目整合。Simplified integration: Easily integrate with Azure services and software-as-a-service (SaaS) offerings.

  • 彈性開發:透過 GitHubAzure DevOps Services 與其他支援的開發工具設定連續整合並部署您的程式碼。Flexible development: Set up continuous integration and deploy your code through GitHub, Azure DevOps Services, and other supported development tools.

  • 具狀態的無伺服器架構:使用 Durable Functions 來協調無伺服器應用程式。Stateful serverless architecture: Orchestrate serverless applications with Durable Functions.

  • 開放原始碼:Functions 執行階段是開放原始碼,且可在 GitHub 上取得Open-source: The Functions runtime is open-source and available on GitHub.

我可以用 Functions 來做什麼?What can I do with Functions?

Functions 是處理大量資料、整合系統、使用物聯網 (IoT),以及建置簡單 API 和微服務的絕佳解決方案。Functions is a great solution for processing bulk data, integrating systems, working with the internet-of-things (IoT), and building simple APIs and micro-services.

您可以利用一系列的範本來展開重要的案例,包括︰A series of templates is available to get you started with key scenarios including:

Functions 的計費方式How much does Functions cost?

Azure Functions 有三種定價方案。Azure Functions has three kinds of pricing plans. 請選擇最符合您需求的方案:Choose the one that best fits your needs:

  • 使用量方案:Azure 會提供所有必要的運算資源。Consumption plan: Azure provides all of the necessary computational resources. 您不必擔心資源管理,且只需針對程式碼執行的時間支付費用。You don't have to worry about resource management, and only pay for the time that your code runs.

  • 進階方案:您可以指定一些預先準備的執行個體,而這些執行個體一律會上線並且可立即回應。Premium plan: You specify a number of pre-warmed instances that are always online and ready to immediately respond. 當您的函式執行時,Azure 會提供所需的任何額外計算資源。When your function runs, Azure provides any additional computational resources that are needed. 您會針對持續執行的預先準備執行個體,以及在 Azure 相應放大和縮小您應用程式時使用的任何其他執行個體付費。You pay for the pre-warmed instances running continuously and any additional instances you use as Azure scales your app in and out.

  • App Service 方案:像執行 Web 應用程式一樣執行您的函式。App Service plan: Run your functions just like your web apps. 如果您對其他應用程式使用 App Service,您可以在相同方案上執行您的函式,不會產生額外的費用。If you use App Service for your other applications, your functions can run on the same plan at no additional cost.

如需主控方案的詳細資訊,請參閱 Azure Functions 主控方案比較For more information about hosting plans, see Azure Functions hosting plan comparison. Functions 價格頁面上可取得完整的價格詳細資料。Full pricing details are available on the Functions Pricing page.

後續步驟Next Steps