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: docs/deploy_features.md
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ You should typically enable these features before running `azd up`. Once you've
12
12
*[Enabling login and document level access control](#enabling-login-and-document-level-access-control)
13
13
*[Enabling user document upload](#enabling-user-document-upload)
14
14
*[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)
15
17
*[Using local parsers](#using-local-parsers)
16
18
17
19
## Using GPT-4
@@ -52,11 +54,12 @@ Execute the following commands inside your terminal:
52
54
53
55
> [!NOTE]
54
56
> 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.
60
63
>
61
64
> 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.
62
65
@@ -86,7 +89,7 @@ By default, the deployed Azure web app uses the `text-embedding-ada-002` embeddi
86
89
azd env set AZURE_OPENAI_EMB_DEPLOYMENT_VERSION 1
87
90
```
88
91
89
-
3. When prompted during `azd up`, make sure to selecta 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 selecta 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).
90
93
91
94
If you have already deployed:
92
95
@@ -151,7 +154,6 @@ And then update existing search documents with the storage URL of the main Blob
151
154
Going forward, all uploaded documents will have their `storageUrl` set in the search index.
152
155
This is necessary to disambiguate user-uploaded documents from admin-uploaded documents.
153
156
154
-
155
157
## Enabling CORS for an alternate frontend
156
158
157
159
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
166
168
on [using a different backend](https://github.com/Azure-Samples/azure-search-openai-javascript#using-a-different-backend).
167
169
Both these repositories adhere to the same [HTTP protocol for RAG chat apps](https://github.com/Azure-Samples/ai-chat-app-protocol).
168
170
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
+
169
183
## Using local parsers
170
184
171
185
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.
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.
21
21
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.
24
24
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`
30
31
31
32
## Recommended deployment strategy for private access
32
33
33
34
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