Skip to content

Commit 8f7b33a

Browse files
author
gitName
committed
[APIM] External cache updates for AMR
1 parent caea2ea commit 8f7b33a

File tree

4 files changed

+32
-35
lines changed

4 files changed

+32
-35
lines changed

articles/api-management/api-management-howto-cache-external.md

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66

77
ms.service: azure-api-management
88
ms.topic: how-to
9-
ms.date: 05/19/2022
9+
ms.date: 01/13/2025
1010
ms.author: danlep
1111

1212
---
@@ -15,7 +15,7 @@ ms.author: danlep
1515

1616
[!INCLUDE [api-management-availability-all-tiers](../../includes/api-management-availability-all-tiers.md)]
1717

18-
In addition to utilizing the built-in cache, Azure API Management allows for caching responses in an external Redis-compatible cache, such as Azure Cache for Redis.
18+
In addition to utilizing the built-in cache, Azure API Management allows for caching responses in an external Redis-compatible cache, such as Azure Cache for Redis or Azure Managed Redis.
1919

2020
Using an external cache allows you to overcome a few limitations of the built-in cache:
2121

@@ -29,7 +29,6 @@ For more detailed information about caching, see [API Management caching policie
2929

3030
[!INCLUDE [api-management-workspace-availability](../../includes/api-management-workspace-availability.md)]
3131

32-
![Bring your own cache to APIM](media/api-management-howto-cache-external/overview.png)
3332

3433
What you'll learn:
3534

@@ -42,18 +41,16 @@ To complete this tutorial, you need to:
4241

4342
+ [Create an Azure API Management instance](get-started-create-service-instance.md)
4443
+ Understand [caching in Azure API Management](api-management-howto-cache.md)
44+
+ Have an [Azure Cache for Redis](../azure-cache-for-redis/quickstart-create-redis), [Azure Managed Redis](../azure-cache-for-redis/quickstart-create-managed-redis.md), or another Redis-compatible cache available.
4545

46-
## <a name="create-cache"> </a> Create Azure Cache for Redis
46+
> [!IMPORTANT]
47+
> Azure API Management uses a Redis connection string to connect to the cache. If you use Azure Cache for Redis or Azure Managed Redis, enable access keys authentication in your cache to use a connection string. Currently, you can't use Microsoft Entra authentication to connect from Azure API Management to Azure Cache for Redis or Azure Managed Redis.
4748
48-
This section explains how to create an Azure Cache for Redis in Azure. If you already have an Azure Cache for Redis, or another Redis-compatible cache within or outside of Azure, you can <a href="#add-external-cache">skip</a> to the next section.
49+
### Redis cache for Kubernetes
4950

50-
[!INCLUDE [redis-cache-create](~/reusable-content/ce-skilling/azure/includes/azure-cache-for-redis/includes/redis-cache-create.md)]
51+
For an API Management self-hosted gateway, caching requires an external cache. For caching to be effective, a self-hosted gateway and the cache it relies on must be located close to each other to minimize lookup and store latencies. Deploying a Redis cache into the same Kubernetes cluster or in a separate cluster nearby are the best options. Learn how to [deploy Redis cache to a Kubernetes cluster](https://github.com/kubernetes/examples/tree/master/guestbook).
5152

52-
## <a name="create-cache"> </a> Deploy Redis cache to Kubernetes
53-
54-
For a self-hosted gateway, caching requires an external cache. For caching to be effective, a self-hosted gateway and the cache it relies on must be located close to each other to minimize lookup and store latencies. Deploying a Redis cache into the same Kubernetes cluster or in a separate cluster nearby are the best options. Learn how to [deploy Redis cache to a Kubernetes cluster](https://github.com/kubernetes/examples/tree/master/guestbook).
55-
56-
## <a name="add-external-cache"> </a>Add an external cache
53+
## Add an external cache
5754

5855
Follow the steps below to add an external Redis-compatible cache in Azure API Management. You can limit the cache to a specific gateway in your API Management instance.
5956

@@ -76,45 +73,45 @@ The **Use from** setting in the configuration specifies the location of your API
7673
> [!NOTE]
7774
> You can configure the same external cache for more than one API Management instance. The API Management instances can be in the same or different regions. When sharing the cache for more than one instance, you must select **Default** in the **Use from** setting.
7875
79-
### Add an Azure Cache for Redis from the same subscription
76+
### Add an Azure Cache for Redis or Azure Managed Redis instance from the same subscription
8077

8178
1. Browse to your API Management instance in the Azure portal.
82-
2. Select the **External cache** tab from the menu on the left.
83-
3. Select the **+ Add** button.
84-
4. Select your cache in the **Cache instance** dropdown field.
85-
5. Select **Default** or specify the desired region in the [**Use from**](#use-from-setting) dropdown field.
86-
6. Select **Save**.
79+
1. In the left menu, under **Deployment + infrastructure** select **External cache**.
80+
1. Select **+ Add**.
81+
1. In the **Cache instance** dropdown, select your cache.
82+
1. In the [**Use from**](#use-from-setting) dropdown, select **Default** or specify the desired region. The **Connection string** is automatically populated.
83+
1. Select **Save**.
8784

8885
### Add a Redis-compatible cache hosted outside of the current Azure subscription or Azure in general
8986

9087
1. Browse to your API Management instance in the Azure portal.
91-
2. Select the **External cache** tab from the menu on the left.
92-
3. Select the **+ Add** button.
93-
4. Select **Custom** in the **Cache instance** dropdown field.
94-
5. Select **Default** or specify the desired region in the [**Use from**](#use-from-setting) dropdown field.
95-
6. Provide your Azure Cache for Redis (or Redis-compatible cache) connection string in the **Connection string** field.
96-
7. Select **Save**.
88+
1. In the left menu, under **Deployment + infrastructure** select **External cache**.
89+
1. Select **+ Add**.
90+
1. In the **Cache instance** dropdown, select **Custom**.
91+
1. In the [**Use from**](#use-from-setting) dropdown, select **Default** or specify the desired region.
92+
1. Enter your Azure Cache for Redis, Azure Managed Redis, or Redis-compatible cache connection string in the **Connection string** field.
93+
1. Select **Save**.
9794

9895
### Add a Redis cache to a self-hosted gateway
9996

100-
1. Browse to your API Management instance in the Azure portal.
101-
2. Select the **External cache** tab from the menu on the left.
102-
3. Select the **+ Add** button.
103-
4. Select **Custom** in the **Cache instance** dropdown field.
104-
5. Specify the desired self-hosted gateway location or **Default** in the [**Use from**](#use-from-setting) dropdown field.
105-
6. Provide your Redis cache connection string in the **Connection string** field.
106-
7. Select **Save**.
97+
1. In the left menu, under **Deployment + infrastructure** select **External cache**.
98+
1. Select **+ Add**.
99+
1. In the **Cache instance** dropdown, select **Custom**.
100+
1. In the [**Use from**](#use-from-setting) dropdown, select **Default** or specify the desired region.
101+
1. Enter your Redis cache connection string in the **Connection string** field.
102+
1. Select **Save**.
107103

108104
## Use the external cache
109105

110106
After adding a Redis-compatible cache, configure [caching policies](api-management-policies.md#caching) to enable response caching, or caching of values by key, in the external cache.
111107

112108
For a detailed example, see [Add caching to improve performance in Azure API Management](api-management-howto-cache.md).
113109

114-
## <a name="next-steps"> </a>Next steps
110+
## Related content
115111

116112
* For more information about caching policies, see [Caching policies][Caching policies] in the [API Management policy reference][API Management policy reference].
117113
* To cache items by key using policy expressions, see [Custom caching in Azure API Management](api-management-sample-cache-by-key.md).
114+
* Learn how to [enable semantic caching for Azure OpenAI APIs](azure-openai-enable-semantic-caching.md).
118115

119116
[API Management policy reference]: ./api-management-policies.md
120117
[Caching policies]: ./api-management-policies.md#caching

articles/api-management/azure-openai-enable-semantic-caching.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.service: azure-api-management
66
ms.custom:
77
- build-2024
88
ms.topic: how-to
9-
ms.date: 12/13/2024
9+
ms.date: 01/13/2025
1010
ms.author: danlep
1111
ms.collection: ce-skilling-ai-copilot
1212
---
@@ -27,10 +27,10 @@ Enable semantic caching of responses to Azure OpenAI API requests to reduce band
2727
* Chat Completion API (or Completion API) - Deployment used for API consumer calls
2828
* Embeddings API - Deployment used for semantic caching
2929
* The API Management instance must be configured to use managed identity authentication to the Azure OpenAI APIs. For more information, see [Authenticate and authorize access to Azure OpenAI APIs using Azure API Management ](api-management-authenticate-authorize-azure-openai.md#authenticate-with-managed-identity).
30-
* [Azure Cache for Redis Enterprise](../azure-cache-for-redis/quickstart-create-redis-enterprise.md). The **RediSearch** module must be enabled on the Redis Enterprise cache.
30+
* An [Azure Cache for Redis Enterprise](../azure-cache-for-redis/quickstart-create-redis-enterprise.md) or [Azure Managed Redis](../azure-cache-for-redis/azure-cache-for-redis/quickstart-create-managed-redis.md) instance. The **RediSearch** module must be enabled on the Redis cache; no other modules may be enabled.
3131
> [!NOTE]
32-
> You can only enable the **RediSearch** module when creating a new Redis Enterprise cache. You can't add a module to an existing cache. [Learn more](../azure-cache-for-redis/cache-redis-modules.md)
33-
* External cache configured in the Azure API Management instance. For steps, see [Use an external Azure Cache for Redis in Azure API Management](api-management-howto-cache-external.md).
32+
> You can only enable the **RediSearch** module when creating a new Azure Redis Enterprise or Azure Managed Redis cache. You can't add a module to an existing cache. [Learn more](../azure-cache-for-redis/cache-redis-modules.md)
33+
* External cache configured in the Azure API Management instance. For steps, see [Use an external Redis-compatible cache in Azure API Management](api-management-howto-cache-external.md).
3434

3535

3636
## Test Chat API deployment
58 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)