You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/api-management/backends.md
+95-7Lines changed: 95 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ editor: ''
8
8
9
9
ms.service: api-management
10
10
ms.topic: article
11
-
ms.date: 09/21/2021
11
+
ms.date: 08/16/2023
12
12
ms.author: danlep
13
13
ms.custom:
14
14
---
@@ -17,7 +17,7 @@ ms.custom:
17
17
18
18
A *backend* (or *API backend*) in API Management is an HTTP service that implements your front-end API and its operations.
19
19
20
-
When importing certain APIs, API Management configures the API backend automatically. For example, API Management configures the backend when importing:
20
+
When importing certain APIs, API Management configures the API backend automatically. For example, API Management configures the backend web service when importing:
21
21
* An [OpenAPI specification](import-api-from-oas.md).
22
22
* A [SOAP API](import-soap-api.md).
23
23
* Azure resources, such as an HTTP-triggered [Azure Function App](import-function-app-as-api.md) or [Logic App](import-logic-app-as-api.md).
@@ -26,12 +26,9 @@ API Management also supports using other Azure resources as an API backend, such
26
26
* A [Service Fabric cluster](how-to-configure-service-fabric-backend.md).
27
27
* A custom service.
28
28
29
-
Custom backends require extra configuration to authorize the credentials of requests to the backend service and define API operations. Configure and manage custom backends in the Azure portal, or using Azure APIs or tools.
29
+
API Management supports custom backends so you can manage the backend services of your API. Use custom backends, for example, to authorize the credentials of requests to the backend service. Configure and manage custom backends in the Azure portal, or using Azure APIs or tools.
30
30
31
-
After creating a backend, you can reference the backend in your APIs. Use the [`set-backend-service`](set-backend-service-policy.md) policy to redirect an incoming API request to the custom backend instead of the default backend for that API.
32
-
33
-
> [!NOTE]
34
-
> When you use the `set-backend-service` policy to redirect requests to a custom backend, refer to the backend by its name (`backend-id`), not by its URL.
31
+
After creating a backend, you can reference the backend in your APIs. Use the [`set-backend-service`](set-backend-service-policy.md) policy to direct an incoming API request to the custom backend. If you already configured a backend web service for an API, you can use the `set-backend-service` policy to redirect the request to a custom backend instead of the default backend web service configured for that API.
35
32
36
33
## Benefits of backends
37
34
@@ -41,6 +38,97 @@ A custom backend has several benefits, including:
41
38
* Easily used by configuring a transformation policy on an existing API.
42
39
* Takes advantage of API Management functionality to maintain secrets in Azure Key Vault if [named values](api-management-howto-properties.md) are configured for header or query parameter authentication.
43
40
41
+
## Circuit breaker (preview)
42
+
43
+
Starting in API version 2023-03-01 preview, API Management exposes a [circuit breaker](/rest/api/apimanagement/current-preview/backend/create-or-update?tabs=HTTP#backendcircuitbreaker) property in the backend resource to protect a backend service from being overwhelmed by too many requests.
44
+
45
+
* The circuit breaker property defines rules to trip the circuit breaker, such as the number or percentage of failure conditions during a defined time interval and a range of status codes that indicate failures.
46
+
* When the circuit breaker trips, API Management stops sending requests to the backend service for a defined time, and returns a 503 Service Unavailable response to the client.
47
+
* After the configured trip duration, the circuit resets and traffic resumes to the backend.
48
+
49
+
The backend circuit breaker is an implementation of the [circuit breaker pattern](/azure/architecture/patterns/circuit-breaker) to allow the backend to recover from overload situations. It augments general [rate-limiting](rate-limit-policy.md) and [concurrency-limiting](limit-concurrency-policy.md) policies that you can implement to protect the API Management gateway and your backend services.
50
+
51
+
### Example
52
+
53
+
Use the API Management REST API or a Bicep or ARM template to configure a circuit breaker in a backend. In the following example, the circuit breaker trips when there are three or more `5xx` status codes indicating server errors in a day. The circuit breaker resets after one hour.
54
+
55
+
#### [Bicep](#tab/bicep)
56
+
57
+
Include a snippet similar to the following in your Bicep template:
For **Developer** and **Premium** tiers, an API Management instance deployed in an [internal virtual network](api-management-using-with-internal-vnet.md) can throw HTTP 500 `BackendConnectionFailure` errors when the gateway endpoint URL and backend URL are the same. If you encounter this limitation, follow the instructions in the [Self-Chained API Management request limitation in internal virtual network mode](https://techcommunity.microsoft.com/t5/azure-paas-blog/self-chained-apim-request-limitation-in-internal-virtual-network/ba-p/1940417) article in the Tech Community blog.
0 commit comments