Skip to content

Commit 3822c52

Browse files
authored
Additional pointers to docs on private endpoints and load balancing (#1618)
* More instructions * Updated TOC * Markdown lint stuff * More markdown fixes
1 parent 7366e50 commit 3822c52

File tree

3 files changed

+52
-32
lines changed

3 files changed

+52
-32
lines changed

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ These are advanced topics that are not necessary for a basic deployment.
99
* [Enabling optional features](deploy_features.md)
1010
* [Login and access control](login_and_acl.md)
1111
* [GPT-4 Turbo with Vision](gpt4v.md)
12+
* [Private endpoints](deploy_private.md)
1213
* [Debugging the app on App Service](appservice.md)
1314
* [Local development](localdev.md)
1415
* [App customization](customization.md)

docs/deploy_features.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ You should typically enable these features before running `azd up`. Once you've
1212
* [Enabling login and document level access control](#enabling-login-and-document-level-access-control)
1313
* [Enabling user document upload](#enabling-user-document-upload)
1414
* [Enabling CORS for an alternate frontend](#enabling-cors-for-an-alternate-frontend)
15+
* [Adding an OpenAI load balancer](#adding-an-openai-load-balancer)
16+
* [Deploying with private endpoints](#deploying-with-private-endpoints)
1517
* [Using local parsers](#using-local-parsers)
1618

1719
## Using GPT-4
@@ -52,11 +54,12 @@ Execute the following commands inside your terminal:
5254

5355
> [!NOTE]
5456
> To revert back to GPT 3.5, run the following commands:
55-
> - `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT chat` to set the name of your old GPT 3.5 deployment.
56-
> - `azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-35-turbo` to set the name of your old GPT 3.5 model.
57-
> - `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY 30` to set the capacity of your old GPT 3.5 deployment.
58-
> - `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 0613` to set the version number of your old GPT 3.5.
59-
> - `azd up` to update the provisioned resources.
57+
>
58+
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT chat` to set the name of your old GPT 3.5 deployment.
59+
> * `azd env set AZURE_OPENAI_CHATGPT_MODEL gpt-35-turbo` to set the name of your old GPT 3.5 model.
60+
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_CAPACITY 30` to set the capacity of your old GPT 3.5 deployment.
61+
> * `azd env set AZURE_OPENAI_CHATGPT_DEPLOYMENT_VERSION 0613` to set the version number of your old GPT 3.5.
62+
> * `azd up` to update the provisioned resources.
6063
>
6164
> Note that this does not delete your GPT-4 deployment; it just makes your application create a new or reuse an old GPT 3.5 deployment. If you want to delete it, you can go to your Azure OpenAI studio and do so.
6265

@@ -86,7 +89,7 @@ By default, the deployed Azure web app uses the `text-embedding-ada-002` embeddi
8689
azd env set AZURE_OPENAI_EMB_DEPLOYMENT_VERSION 1
8790
```
8891

89-
3. When prompted during `azd up`, make sure to select a region for the OpenAI resource group location that supports the text-embedding-3 models. There are [limited regions available](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#embeddings-models).
92+
4. When prompted during `azd up`, make sure to select a region for the OpenAI resource group location that supports the text-embedding-3 models. There are [limited regions available](https://learn.microsoft.com/azure/ai-services/openai/concepts/models#embeddings-models).
9093

9194
If you have already deployed:
9295

@@ -151,7 +154,6 @@ And then update existing search documents with the storage URL of the main Blob
151154
Going forward, all uploaded documents will have their `storageUrl` set in the search index.
152155
This is necessary to disambiguate user-uploaded documents from admin-uploaded documents.
153156
154-
155157
## Enabling CORS for an alternate frontend
156158
157159
By default, the deployed Azure web app will only allow requests from the same origin. To enable CORS for a frontend hosted on a different origin, run:
@@ -166,6 +168,18 @@ For an alternate frontend that's written in Web Components and deployed to Stati
166168
on [using a different backend](https://github.com/Azure-Samples/azure-search-openai-javascript#using-a-different-backend).
167169
Both these repositories adhere to the same [HTTP protocol for RAG chat apps](https://github.com/Azure-Samples/ai-chat-app-protocol).
168170

171+
## Adding an OpenAI load balancer
172+
173+
As discussed in more details in our [productionizing guide](docs/productionizing.md), you may want to consider implementing a load balancer between OpenAI instances if you are consistently going over the TPM limit.
174+
Fortunately, this repository is designed for easy integration with other repositories that create load balancers for OpenAI instances. For seamless integration instructions with this sample, please check:
175+
176+
* [Scale Azure OpenAI for Python with Azure API Management](https://learn.microsoft.com/azure/developer/python/get-started-app-chat-scaling-with-azure-api-management)
177+
* [Scale Azure OpenAI for Python chat using RAG with Azure Container Apps](https://learn.microsoft.com/azure/developer/python/get-started-app-chat-scaling-with-azure-container-apps)
178+
179+
## Deploying with private endpoints
180+
181+
It is possible to deploy this app with public access disabled, using Azure private endpoints and private DNS Zones. For more details, read [the private deployment guide](docs/deploy_private.md). That requires a multi-stage provisioning, so you will need to do more than just `azd up` after setting the environment variables.
182+
169183
## Using local parsers
170184

171185
If you want to decrease the charges by using local parsers instead of Azure Document Intelligence, you can set environment variables before running the [data ingestion script](./data_ingestion.md). Note that local parsers will generally be not as sophisticated.

docs/deploy_private.md

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,46 @@ If you want to disable public access when deploying the Chat App, you can do so
88
Deploying with public access disabled adds additional cost to your deployment. Please see pricing for the following products:
99

1010
1. [Private Endpoints](https://azure.microsoft.com/pricing/details/private-link/)
11-
1. The exact number of private endpoints created depends on the [optional features](./deploy_features.md) used.
11+
1. The exact number of private endpoints created depends on the [optional features](./deploy_features.md) used.
1212
1. [Private DNS Zones](https://azure.microsoft.com/pricing/details/dns/)
1313
1. (Optional, but recommended)[Azure Virtual Machines](https://azure.microsoft.com/pricing/details/virtual-machines/windows/)
1414
1. (Optional, but recommended)[Azure Bastion](https://azure.microsoft.com/pricing/details/azure-bastion/)
1515

1616
## Environment variables controlling private access
1717

1818
1. `AZURE_PUBLIC_NETWORK_ACCESS`: Controls the value of public network access on supported Azure resources. Valid values are 'Enabled' or 'Disabled'.
19-
1. When public network access is 'Enabled', Azure resources are open to the internet.
20-
1. When public network access is 'Disabled', Azure resources are only accessible over a virtual network.
19+
1. When public network access is 'Enabled', Azure resources are open to the internet.
20+
1. When public network access is 'Disabled', Azure resources are only accessible over a virtual network.
2121
1. `AZURE_USE_PRIVATE_ENDPOINT`: Controls deployment of [private endpoints](https://learn.microsoft.com/azure/private-link/private-endpoint-overview) which connect Azure resources to the virtual network.
22-
1. When set to 'true', ensures private endpoints are deployed for connectivity even when `AZURE_PUBLIC_NETWORK_ACCESS` is 'Disabled'.
23-
1. Note that private endpoints do not make the chat app accessible from the internet. Connections must be initiated from inside the virtual network.
22+
1. When set to 'true', ensures private endpoints are deployed for connectivity even when `AZURE_PUBLIC_NETWORK_ACCESS` is 'Disabled'.
23+
1. Note that private endpoints do not make the chat app accessible from the internet. Connections must be initiated from inside the virtual network.
2424
1. `AZURE_PROVISION_VM`: Controls deployment of a [virtual machine](https://learn.microsoft.com/azure/virtual-machines/overview) and [Azure Bastion](https://learn.microsoft.com/azure/bastion/bastion-overview). Azure Bastion allows you to securely connect to the virtual machine, without being connected virtual network. Since the virtual machine is connected to the virtual network, you are able to access the chat app.
25-
1. You must set `AZURE_VM_USERNAME` and `AZURE_VM_PASSWORD` to provision the built-in administrator account with the virtual machine so you can log in through Azure Bastion.
26-
1. By default, a server version of Windows is used for the VM. If you need to [enroll your device in Microsoft Intune](https://learn.microsoft.com/mem/intune/user-help/enroll-windows-10-device), you should use a desktop version of Windows by setting the following environment variables:
27-
* `azd env set AZURE_VM_OS_PUBLISHER MicrosoftWindowsDesktop`
28-
* `azd env set AZURE_VM_OS_OFFER Windows-11`
29-
* `azd env set AZURE_VM_OS_VERSION win11-23h2-pro`
25+
1. You must set `AZURE_VM_USERNAME` and `AZURE_VM_PASSWORD` to provision the built-in administrator account with the virtual machine so you can log in through Azure Bastion.
26+
1. By default, a server version of Windows is used for the VM. If you need to [enroll your device in Microsoft Intune](https://learn.microsoft.com/mem/intune/user-help/enroll-windows-10-device), you should use a desktop version of Windows by setting the following environment variables:
27+
28+
* `azd env set AZURE_VM_OS_PUBLISHER MicrosoftWindowsDesktop`
29+
* `azd env set AZURE_VM_OS_OFFER Windows-11`
30+
* `azd env set AZURE_VM_OS_VERSION win11-23h2-pro`
3031

3132
## Recommended deployment strategy for private access
3233

3334
1. Deploy the app with private endpoints enabled and public access enabled.
34-
```
35-
azd env set AZURE_USE_PRIVATE_ENDPOINT true
36-
azd env set AZURE_PUBLIC_NETWORK_ACCESS Enabled
37-
azd up
38-
```
39-
2. Validate that you can connect to the chat app and it's working as expected from the internet.
40-
3. Re-provision the app with public access disabled.
41-
```
42-
azd env set AZURE_PUBLIC_NETWORK_ACCESS Disabled
43-
azd env set AZURE_PROVISION_VM true # Optional but recommended
44-
azd env set AZURE_VM_USERNAME myadminusername # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-username-requirements-when-creating-a-vm-
45-
azd env set AZURE_VM_PASSWORD mypassword # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm-
46-
azd provision
47-
```
48-
4. Log into your new VM using [Azure Bastion](https://learn.microsoft.com/azure/bastion/tutorial-create-host-portal#connect). Validate the chat app is accessible from the virtual machine using a web browser.
35+
36+
```shell
37+
azd env set AZURE_USE_PRIVATE_ENDPOINT true
38+
azd env set AZURE_PUBLIC_NETWORK_ACCESS Enabled
39+
azd up
40+
```
41+
42+
1. Validate that you can connect to the chat app and it's working as expected from the internet.
43+
1. Re-provision the app with public access disabled.
44+
45+
```shell
46+
azd env set AZURE_PUBLIC_NETWORK_ACCESS Disabled
47+
azd env set AZURE_PROVISION_VM true # Optional but recommended
48+
azd env set AZURE_VM_USERNAME myadminusername # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-username-requirements-when-creating-a-vm-
49+
azd env set AZURE_VM_PASSWORD mypassword # https://learn.microsoft.com/azure/virtual-machines/windows/faq#what-are-the-password-requirements-when-creating-a-vm-
50+
azd provision
51+
```
52+
53+
1. Log into your new VM using [Azure Bastion](https://learn.microsoft.com/azure/bastion/tutorial-create-host-portal#connect). Validate the chat app is accessible from the virtual machine using a web browser.

0 commit comments

Comments
 (0)