Skip to content

Commit 89a695d

Browse files
committed
in-progress for cherry-pick
1 parent 22e7c00 commit 89a695d

File tree

2 files changed

+47
-43
lines changed

2 files changed

+47
-43
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Create serverless APIs using Azure Functions
3+
description: Describes how to use Azure Functions as the basis of a cohesive set of serverless APIs.
4+
ms.topic: conceptual
5+
ms.date: 09/07/2022
6+
7+
---
8+
# Serverless REST APIs using Azure Functions
9+
10+
Azure Functions is an essential compute service that you use to build serverless REST-based APIs. HTTP triggers expose REST endpoints that can be called by your clients, like browsers, mobile apps, and other backend services. With [native support for routes](functions-bindings-http-webhook-trigger.md#customize-the-http-endpoint), a single HTTP triggered function can expose a highly functional REST API. Functions even natively provides a basic key-based authorization scheme to help limit access only to specific clients. For more information, see [Azure Functions HTTP trigger](functions-bindings-http-webhook-trigger.md)
11+
12+
In some scenarios, you may need your API to support a more complex set of REST behaviors. For example, you may need to combine more multiple HTTP triggered functions into a single API. You might also want to pass requests through to one or more backend REST-based services. Finally, you might want to implement a higher-degree of security for your API and potentially monetize its use.
13+
14+
The recommend approach to build more complex and robust APIs based on your functions is to leverage the comprehensive API services provided by [Azure API Management](../api-management/api-management-key-concepts.md). The legacy [Functions Proxies feature](legacy-proxies.md) also provided a subset of these features for version 3.x and older version of the Functions runtime. The following table compares API Management with the legacy Proxies feature:
15+
16+
| | API Management | Functions proxies |
17+
| --- | --- | --- |
18+
| Runtime versions | All | v1.x-v3.x<br/>v4.x (legacy-only) |
19+
| Hosting | API Management | Functions|
20+
21+
Azure Functions proxies
22+
23+
We are no longer investing in Azure Functions proxy support and strongly recommend customers to Azure API Management (in premium or consumption tier) when building API's with Azure Functions. It provides the same capabilities as Functions Proxies as well as other tools for defining, securing, and maintaining APIs, such as OpenAPI integration, rate limiting, and advanced policies. The key reason for this decision is to avoid duplication of functionality and provide a richer set of capabilities as detailed in [Azure APIM](https://docs.microsoft.com/en-us/azure/api-management/).
24+
25+
This article has basic pointers on migrating to APIM, however we are fully aware that it is not exhaustive and would be interested to learn more if Azure API Management does not fit your scenarios or if you have challenges. Please fill out this survey OR create issues on <github repo> so we can build seamless integration experiences.
26+
27+
This article explains how to configure and work with Azure Functions Proxies. With this feature, you can specify endpoints on your function app that are implemented by another resource. You can use these proxies to break a large API into multiple function apps (as in a microservice architecture), while still presenting a single API surface for clients.
28+
29+
Standard Functions billing applies to proxy executions. For more information, see [Azure Functions pricing](https://azure.microsoft.com/pricing/details/functions/).
30+
31+
> [!NOTE]
32+
> Proxies is available in Azure Functions [versions](./functions-versions.md) 1.x to 3.x. In general, you will need to upgrade your Function applications to the 4.x host runtime by December 13th, 2022 due to EOL support. See more [here], so migrating to using API Management will ensure your applications are continued to be supported. Only for cases where migration is absolutely not possible, we are adding proxy support back in Functions 4.x, so your applications can keep running without disruption.
33+
34+
35+
## Next steps

articles/azure-functions/functions-proxies.md renamed to articles/azure-functions/legacy-proxies.md

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
---
2-
title: Work with proxies in Azure Functions
3-
description: Overview of how to use Azure Functions Proxies
4-
2+
title: Work with legacy proxies in Azure Functions
3+
description: Overview of how to use the legacy Proxies feature in Azure Functions
54
ms.topic: conceptual
6-
ms.date: 11/08/2021
5+
ms.date: 09/08/2022
76

87
---
9-
# Azure Functions Proxies (To be Deprecated - Sep 2025)
10-
11-
Azure Functions proxies
8+
# Work with legacy Proxies Azure Functions
129

13-
We are no longer investing in Azure Functions proxy support and strongly recommend customers to Azure API Management (in premium or consumption tier) when building API's with Azure Functions. It provides the same capabilities as Functions Proxies as well as other tools for building and maintaining APIs, such as OpenAPI integration, rate limiting, and advanced policies. The key reason for this decision is to avoid duplication of functionality and provide a richer set of capabilities as detailed in [Azure APIM](https://docs.microsoft.com/en-us/azure/api-management/).
10+
> [!IMPORTANT]
11+
> Proxies is a legacy feature of Azure Functions [versions](./functions-versions.md) 1.x to 3.x. Proxies are only supported in version 4.x of the Functions runtime to allow you to successfully upgrade your function apps to the latest runtime version. To take advantage of a more complete set of API behaviors, you should switch to using [Azure API Management](../api-management/api-management-key-concepts.md) for exposing and managing your APIs at the earliest possible convenience.
12+
>
1413
15-
This article has basic pointers on migrating to APIM, however we are fully aware that it is not exhaustive and would be interested to learn more if Azure API Management does not fit your scenarios or if you have challenges. Please fill out this survey OR create issues on <github repo> so we can build seamless integration experiences.
14+
>
15+
> You should also consider using It provides the same capabilities as Functions Proxies as well as other tools for building and maintaining APIs, such as OpenAPI integration, rate limiting, and advanced policies.
1616
1717
This article explains how to configure and work with Azure Functions Proxies. With this feature, you can specify endpoints on your function app that are implemented by another resource. You can use these proxies to break a large API into multiple function apps (as in a microservice architecture), while still presenting a single API surface for clients.
1818

1919
Standard Functions billing applies to proxy executions. For more information, see [Azure Functions pricing](https://azure.microsoft.com/pricing/details/functions/).
2020

21-
> [!NOTE]
22-
> Proxies is available in Azure Functions [versions](./functions-versions.md) 1.x to 3.x. In general, you will need to upgrade your Function applications to the 4.x host runtime by December 13th, 2022 due to EOL support. See more [here], so migrating to using API Management will ensure your applications are continued to be supported. Only for cases where migration is absolutely not possible, we are adding proxy support back in Functions 4.x, so your applications can keep running without disruption.
2321

24-
## <a name="create"></a>Create a proxy or an APIM instance
2522

26-
# [Proxy](#tab/Proxy)
27-
This section shows you how to create a proxy in the Functions portal.
23+
## <a name="create"></a>Create a proxy
24+
25+
This section shows you how to create a proxy in the Functions portal.
2826

2927
> [!NOTE]
3028
> Not all languages and operating system combinations support in-portal editing. If you're unable to create a proxy in the portal, you can instead manually create a _proxies.json_ file in the root of your function app project folder. To learn more about portal editing support, see [Language support details](functions-create-function-app-portal.md#language-support-details).
@@ -38,23 +36,8 @@ This section shows you how to create a proxy in the Functions portal.
3836

3937
Your proxy now exists as a new endpoint on your function app. From a client perspective, it is equivalent to an HttpTrigger in Azure Functions. You can try out your new proxy by copying the Proxy URL and testing it with your favorite HTTP client.
4038

41-
# [APIM](#tab/APIM)
42-
This section shows you how to create an APIM instance with APIs imported/published from your Http triggered function applications.
43-
44-
Create a new Azure API Management service instance [Quickstart] (https://docs.microsoft.com/en-us/azure/api-management/get-started-create-service-instance). You may also use Azure CLI, Powershell, Visual Studio Code, Bicep or ARM Template to create an APIM instance.
45-
46-
Once the instance is created, you can:
47-
1. [Import an Azure Function App as a new API] (https://docs.microsoft.com/en-us/azure/api-management/import-function-app-as-api#add-new-api-from-azure-function-app)
48-
2. [Append Azure Function App to an existing API] (https://docs.microsoft.com/en-us/azure/api-management/import-function-app-as-api#append-azure-function-app-to-api)
49-
50-
Alternatively, if you are using Visual Studio for your Functions project, you can publish it to a Function App in Azure with API Management integration as detailed [here] (https://docs.microsoft.com/en-us/azure/azure-functions/openapi-apim-integrate-visual-studio).
51-
52-
You can now refine your APIs in API Management in the portal by [editing your OpenAPI definition] (https://docs.microsoft.com/en-us/azure/api-management/edit-api)
53-
5439
## <a name="modify-requests-responses"></a>Modify requests and responses
5540

56-
# [Proxy](#tab/Proxy)
57-
5841
With Azure Functions Proxies, you can modify requests to and responses from the back-end. These transformations can use variables as defined in [Use variables].
5942

6043
### <a name="modify-backend-request"></a>Modify the back-end request
@@ -115,20 +98,6 @@ For example, a back-end URL of *https://%ORDER_PROCESSING_HOST%/api/orders* woul
11598
> [!TIP]
11699
> Use application settings for back-end hosts when you have multiple deployments or test environments. That way, you can make sure that you are always talking to the right back-end for that environment.
117100
118-
# [APIM](#tab/APIM)
119-
120-
In Azure API Management, API publishers can change API behavior through configuration using policies. Policies are a collection of statements that are run sequentially on the request or response of an API.
121-
122-
Policies are applied inside the gateway between the API consumer and the managed API. While the gateway receives requests and forwards them, unaltered, to the underlying API, a policy can apply changes to both the inbound request and outbound response.
123-
124-
You can configure Azure API Management policies at different scopes namely Global, Product, API or Operation.
125-
126-
Learn more about [APIM Policies](https://docs.microsoft.com/en-us/azure/api-management/api-management-howto-policies#-understanding-policy-configuration).
127-
128-
To get started with inbound, outbound and on-error policies, check out the [samples](https://docs.microsoft.com/en-us/azure/api-management/policies/).
129-
130-
Refer an exhaustive list of [all API Management policies](https://docs.microsoft.com/en-us/azure/api-management/api-management-policies).
131-
132101
## <a name="debugProxies"></a>Troubleshoot Proxies
133102

134103
By adding the flag `"debug":true` to any proxy in your `proxies.json` you will enable debug logging. Logs are stored in `D:\home\LogFiles\Application\Proxies\DetailedTrace` and accessible through the advanced tools (kudu). Any HTTP responses will also contain a `Proxy-Trace-Location` header with a URL to access the log file.

0 commit comments

Comments
 (0)