SylviaBABY commented on a change in pull request #784: URL: https://github.com/apache/apisix-website/pull/784#discussion_r760804662
########## File path: website/blog/2021/12/01/apisix-supports-azure-functions.md ########## @@ -0,0 +1,182 @@ +--- +title: "Apache APISIX intergration with Azure Serverless" +author: "Bisakh Mondal" +authorURL: "https://github.com/bisakhmondal" +authorImageURL: "https://avatars.githubusercontent.com/u/41498427?v=4" +keywords: +- Apache APISIX +- Azure Functions +- Microsoft +- Serverless +description: This article talks about the recent addition of a new plugin `azure-functions`, and gives detailed instructions on how to integrate Azure Functions, which is a widely used serverless solution, into the Apache APISIX serverless suite. +tags: [Technology] +--- + +> This article talks about the recent addition of a new plugin `azure-functions`, and gives detailed instructions on how to integrate Azure Functions, which is a widely used serverless solution, into the Apache APISIX serverless suite. + +<!--truncate--> + +Apache APISIX provides support for serverless frameworks for popular cloud vendors (more coming on the way). Instead of hardcoding the function URL into the application, Apache APISIX suggests defining a route with the serverless plugin enabled. It gives the developers the flexibility to hot update the function URI along with completely changing the faas vendor to a different cloud provider with zero hassle. Also, this approach mitigates authorization and authentication concerns from application logic as Apache APISIX has very strong authentication support that could be used to identify and authorize client consumers to access the particular route with the faas. This article talks about the recent addition of a new plugin `azure-functions`, and gives detailed instructions on how to integrate Azure Functions, which is a widely used serverless solution, into the Apache APISIX serverless suite. + +## How azure-functions plugin works + +The `azure-functions` plugin lets the users define an upstream to the azure `HTTP Trigger` serverless function for a gateway URI. If enabled, this plugin terminates the ongoing request to that particular URI and initiates a new request to the azure faas (the new upstream) on behalf of the client with the suitable authorization details set by the users, request headers, request body, params(all these three components are passed from the original request) and returns the response body, status code and the headers back to the original client that has invoked the request to the APISIX agent. + +The plugin supports authorization to azure faas service via API keys and azure active directory. + +## How to Use Azure Functions with Apache APISIX + +The primary goal of the plugin is to proxy the gateway route specified in the route configuration to the azure functions URI. This section gives you a hands-on how to configure and create a serverless HTTP Trigger on the azure cloud. + +1. First sign up/in to Microsoft Azure and sets up a trial plan. Azure Functions are forever free up to 1 million invocations. To know more about how the pricing, visit [here](https://azure.microsoft.com/en-us/services/functions/#pricing). + +1. Visit the [Azure Portal](https://portal.azure.com/#home) (FYI, azure services can be accessed via the web portal, CLI & VSCode. for user-friendliness we are using the web). + 1. First, create a resource group to logically partition your faas that's you are going to create. + ![create a resource group](https://static.apiseven.com/202108/1638349069240-911b8640-2de6-4f82-b75b-fb937b0bad40.png) + 1. Create a function app with the URL of your choice (I am going to pick test-apisix). + ![create a function app](https://static.apiseven.com/202108/1638349121520-01abe8e6-bc09-4be7-b010-f7baec59f89a.png) + +1. Install the [Azure Functions extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) into VSCode editor. Upon installation, authenticate via extension and install the azure function core tool for local development with: + + ```shell + npm install -g azure-functions-core-tools@3 --unsafe-perm true + ``` + +1. Deploy the following snippet to the same function app that we just created via the Azure Functions extension panel in VSCode: Review comment: 列表格式是否应为 1. 2. 3. 等 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org