Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AI scale with APIM #40250

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: Scale Azure OpenAI for .NET with Azure API Management
description: Learn how to add load balancing to your .NET application to extend the chat app beyond the Azure OpenAI token and model quota limits with Azure API Management.
ms.date: 03/29/2024
ms.topic: get-started
ms.custom: devx-track-dotnet, devx-track-dotnet-ai
# CustomerIntent: As a .NET developer new to Azure OpenAI, I want to scale my Azure OpenAI capacity to avoid rate limit errors with Azure API Management.
---

# Scale Azure OpenAI for .NET chat using RAG with Azure API Management

[!INCLUDE [aca-load-balancer-intro](~/azure-dev-docs-pr/articles/intro/includes/scaling-load-balancer-introduction-azure-api-management.md)]

## Prerequisites

* An Azure subscription. [Create one for free.](https://azure.microsoft.com/free/ai-services?azure-portal=true)
* Access granted to Azure OpenAI in the desired Azure subscription.

Currently, access to this service is granted only by application. You can apply for access to Azure OpenAI by completing the [form](https://aka.ms/oai/access).

* [Dev containers](https://containers.dev/) are available for both samples, with all dependencies required to complete this article. You can run the dev containers in GitHub Codespaces (in a browser) or locally using Visual Studio Code.

#### [Codespaces (recommended)](#tab/github-codespaces)

* Only a [GitHub account](https://www.github.com/login) is required to use Codespaces

#### [Visual Studio Code](#tab/visual-studio-code)

* [Azure Developer CLI](/azure/developer/azure-developer-cli/install-azd)
* [Docker Desktop](https://www.docker.com/products/docker-desktop/) - start Docker Desktop if it's not already running
* [Visual Studio Code](https://code.visualstudio.com/) with [Dev Container Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

---

[!INCLUDE [scaling-load-balancer-aca-procedure.md](~/azure-dev-docs-pr/articles/intro/includes/scaling-load-balancer-procedure-azure-api-management.md)]

[!INCLUDE [deployment-procedure](~/azure-dev-docs-pr/articles/intro/includes/redeploy-procedure-chat-azure-api-management.md)]

[!INCLUDE [capacity.md](~/azure-dev-docs-pr/articles/intro/includes/scaling-load-balancer-capacity.md)]

[!INCLUDE [py-apim-cleanup](~/azure-dev-docs-pr/articles/intro/includes/scaling-load-balancer-cleanup-azure-api-management.md)]

## Sample code

Samples used in this article include:

* [.NET chat app with RAG](https://github.com/Azure-Samples/azure-search-openai-demo-csharp)
* [Load Balancer with Azure API Management](https://github.com/Azure-Samples/openai-apim-lb)

## Next steps

* [View Azure API Management diagnostic data in Azure Monitor](/azure/api-management/api-management-howto-use-azure-monitor#view-diagnostic-data-in-azure-monitor)
diberry marked this conversation as resolved.
Show resolved Hide resolved
* Use [Azure Load Testing](/azure/load-testing/) to load test your chat app.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ Samples used in this article include:

## Next step

* Use [Azure Load Testing](/azure/load-testing/) to load test your chat app
* Use [Azure Load Testing](/azure/load-testing/) to load test your chat app.
2 changes: 2 additions & 0 deletions docs/azure/TOC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
href: ../ai/get-started-app-chat-template.md
- name: Scale Azure OpenAI with Azure Container apps
href: ../ai/get-started-app-chat-scaling-with-azure-container-apps.md
- name: Scale Azure OpenAI with Azure API Management
href: ../ai/get-started-app-chat-scaling-with-azure-api-management.md
- name: .NET + AI ecosystem
href: ../ai/dotnet-ai-ecosystem.md
- name: Azure SDK for .NET
Expand Down
Loading