Skip to content

Commit 806874e

Browse files
committed
web app article and article structure
1 parent bd3ea03 commit 806874e

File tree

4 files changed

+86
-78
lines changed

4 files changed

+86
-78
lines changed

articles/ai-services/openai/concepts/use-your-data.md

Lines changed: 69 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,25 @@ To get started, [connect your data source](../use-your-data-quickstart.md) using
3131
> [!NOTE]
3232
> To get started, you need to already have been approved for [Azure OpenAI access](../overview.md#how-do-i-get-access-to-azure-openai) and have an [Azure OpenAI Service resource](../how-to/create-resource.md) with either the gpt-35-turbo or the gpt-4 models deployed.
3333
34+
## Azure Role-based access controls (Azure RBAC) for adding data sources
35+
36+
To use Azure OpenAI on your data fully capability, you need the following Azure RBAC roles
37+
38+
39+
| Azure RBAC role | Which resource needs this role? | Needed when |
40+
|----|----|----|
41+
| Cognitive Services OpenAI Contributor | The Azure AI Search resource, to access Azure OpenAI resource. | You want to use Azure OpenAI on your data. |
42+
| Search Index Data Reader | The Azure OpenAI resource, to access the Azure AI Search resource. | You want to use Azure OpenAI on your data. |
43+
| Search Service Contributor | The Azure OpenAI resource | to access the Azure AI Search resource. |You plan to create a new Azure AI Search index. |
44+
| Storage Blob Data Contributor | You have an existing Blob storage container that you want to use, instead of creating a new one. | The Azure AI Search and Azure OpenAI resources, to access the storage account. |
45+
| Cognitive Services OpenAI User | The web app, to access the Azure OpenAI resource. | You want to deploy a web app. |
46+
| Contributor | Your subscription, to access Azure Resource Manager. | You want to deploy a web app. |
47+
| Cognitive Services Contributor Role | The Azure AI Search resource, to access Azure OpenAI resource. | You want to deploy a web app. |
48+
49+
## Architecture overview
50+
51+
TBD
52+
3453
## Data formats and file types
3554

3655
Azure OpenAI on your data supports the following filetypes:
@@ -55,22 +74,42 @@ There is an [upload limit](../quotas-limits.md), and there are some caveats abou
5574

5675
This will affect the quality of the model response.
5776

58-
## Ingesting your data
77+
## Add your data
78+
79+
You can use Azure OpenAI studio to add all available data sources. You can also use the [ingestion API](../reference.md#start-an-ingestion-job) to upload your data to an Azure blob storage container and Azure AI search service. To add a the Azure Open AI Studio
80+
81+
1. Nativgate to [Azure OpenAI studio](https://oai.azure.com/portal) and select the **Bring your data**.
82+
83+
:::image type="content" source="../media/use-your-data/bring-your-data-landing page.png" alt-text="A screenshot of the Azure OpenAI Studio landing page." lightbox="../media/use-your-data/bring-your-data-landing page.png":::
5984

60-
There are several different sources of data that you can use. The following sources will be connected to Azure AI Search:
61-
* Blobs in an Azure storage container that you provide
62-
* Local files uploaded using the Azure OpenAI Studio
85+
1. In the pane that appears, select your data source option. For example, you can choose **Upload files** to upload files to an Azure blob storage And Azure AI Search service. Follow the steps that appear to add your data source and start ingesting it.
86+
87+
:::image type="content" source="../media/quickstarts/add-your-data-source.png" alt-text="A screenshot showing options for selecting a data source in Azure OpenAI Studio." lightbox="../media/quickstarts/add-your-data-source.png":::
88+
89+
### Data source options
90+
91+
Use the following tabs to learn about the different sources supported by Azure OpenAI.
92+
93+
> [!NOTE]
94+
> The following data sources use Azure AI Search as the search service:
95+
> * Blobs in an Azure storage container that you provide.
96+
> * Local files uploaded using the Azure OpenAI Studio.
97+
98+
You can additionally ingest your data from an existing Azure AI Search service, or use one of the following additional sources
99+
* [Azure Cosmos DB for MongoDB vCore](/azure/cosmos-db/mongodb/vcore/).
100+
* [Pinecone](https://www.pinecone.io/)
101+
* [Azure Machine Learning](/azure/machine-learning/overview-what-is-azure-machine-learning)
102+
* [Elasticsearch](https://www.elastic.co/)
63103

64-
You can additionally ingest your data from an existing Azure AI Search service, or use Azure Cosmos DB for MongoDB vCore.
65104

66105
# [Azure AI Search](#tab/ai-search)
67106

68107
> [!TIP]
69-
> For documents and datasets with long text, you should use the available [data preparation script](https://go.microsoft.com/fwlink/?linkid=2244395). The script chunks data so that your response with the service will be more accurate. This script also supports scanned PDF files and images.
108+
> * For documents and datasets with long text, you should use the available [data preparation script](https://go.microsoft.com/fwlink/?linkid=2244395). The script chunks data so that your response with the service will be more accurate. This script also supports scanned PDF files and images.
70109
71110
Once data is ingested, an [Azure AI Search](/azure/search/search-what-is-azure-search) index in your search resource gets created to integrate the information with Azure OpenAI models.
72111

73-
**Data ingestion from Azure storage containers**
112+
**Data from Azure storage containers**
74113

75114
1. Ingestion assets are created in Azure AI Search resource and Azure storage account. Currently these assets are: indexers, indexes, data sources, a [custom skill](/azure/search/cognitive-search-custom-skill-interface) in the search resource, and a container (later called the chunks container) in the Azure storage account. You can specify the input Azure storage container using the [Azure OpenAI studio](https://oai.azure.com/), or the [ingestion API](../reference.md#start-an-ingestion-job).
76115

@@ -79,13 +118,29 @@ Once data is ingested, an [Azure AI Search](/azure/search/search-what-is-azure-s
79118
3. The preprocessed data is loaded from the chunks container, and indexed in the Azure AI Search index.
80119

81120

82-
**Data ingestion from local files**
121+
**Data from local file upload**
83122

84123
Using Azure OpenAI Studio, you can upload files from your machine. The service then stores the files to an Azure storage container and performs ingestion from the container.
85124

86-
**Data ingestion from URLs**
125+
**Data from URLs**
87126

88-
Using Azure OpenAI Studio, you can paste URLs and the service will store the webpage content, using it when generating responses from the model.
127+
Using Azure OpenAI Studio, you can paste URLs and the service will store the webpage content, using it when generating responses from the model.The content in URLs/web addresses that you use need to have the following characteristics to be properly ingested:
128+
129+
* A public website, such as [Using your data with Azure OpenAI Service - Azure OpenAI | Microsoft Learn](/azure/ai-services/openai/concepts/use-your-data?tabs=ai-search). Note that you cannot add a URL/Web address with access control, such as with password.
130+
* An HTTPS website.
131+
* The size of content in each URL is smaller than 5MB.
132+
* The website can be downloaded as one of the [supported file types](#data-formats-and-file-types).
133+
134+
You can use URL as a data source in both the Azure OpenAI Studio. To use URL/web address as a data source, you need to have an Azure AI Search resource and an Azure Blob Storage resource. When using the Ingestion API you need to create a container first.
135+
136+
> [!TIP]
137+
> Only one layer of nested links is supported. Only up to 20 links, on the web page will be fetched.
138+
139+
<!--:::image type="content" source="../media/use-your-data/url.png" alt-text="A screenshot of the Azure OpenAI use your data url/webpage studio configuration page." lightbox="../media/use-your-data/url.png":::-->
140+
141+
Once you have added the URL/web address for data ingestion, the web pages from your URL are fetched and saved to your Azure Blob Storage account with a container name: `webpage-<index name>`. Each URL will be saved into a different container within the account. Then the files are indexed into an Azure AI Search index, which is used for retrieval when you’re chatting with the model.
142+
143+
When you want to reuse the same URL/web address, you can select [Azure AI Search](/azure/ai-services/openai/concepts/use-your-data?tabs=ai-search) as your data source and select the index you created with your URL previously. Then you can use the already indexed files instead of having the system crawl your URL again. You can use the Azure AI Search index directly and delete the storage container to free up your storage space.
89144

90145
### Troubleshooting failed ingestion jobs
91146

@@ -209,25 +264,13 @@ After ingesting your data, you can start chatting with the model on your data us
209264
* [Web app](#using-the-web-app)
210265
* [REST API](../reference.md#azure-cosmos-db-for-mongodb-vcore)
211266

212-
# [URL/web address](#tab/url-web)
213-
214-
Currently, you can add your data from a URL/web address. Your data from a URL/web address needs to have the following characteristics to be properly ingested:
215-
216-
* A public website, such as [Using your data with Azure OpenAI Service - Azure OpenAI | Microsoft Learn](/azure/ai-services/openai/concepts/use-your-data?tabs=ai-search). Note that you cannot add a URL/Web address with access control, such as with password.
217-
218-
* An HTTPS website.
219-
220-
* The size of content in each URL is smaller than 5MB.
267+
TBD
221268

222-
* The website can be downloaded as one of the [supported file types](#data-formats-and-file-types).
269+
# [Azure Machine Learning](#tab/azure-machine-learning)
223270

224-
You can use URL as a data source in both the Azure OpenAI Studio and the [ingestion API](../reference.md#start-an-ingestion-job). To use URL/web address as a data source, you need to have an Azure AI Search resource and an Azure Blob Storage resource. When using the Ingestion API you need to create a container first. Only one layer of nested links is supported. Only up to 20 links, on the web page will be fetched.
271+
TBD
225272

226-
:::image type="content" source="../media/use-your-data/url.png" alt-text="A screenshot of the Azure OpenAI use your data url/webpage studio configuration page." lightbox="../media/use-your-data/url.png":::
227-
228-
Once you have added the URL/web address for data ingestion, the web pages from your URL are fetched and saved to your Azure Blob Storage account with a container name: `webpage-<index name>`. Each URL will be saved into a different container within the account. Then the files are indexed into an Azure AI Search index, which is used for retrieval when you’re chatting with the model.
229-
230-
When you want to reuse the same URL/web address, you can select [Azure AI Search](/azure/ai-services/openai/concepts/use-your-data?tabs=ai-search) as your data source and select the index you created with your URL previously. Then you can use the already indexed files instead of having the system crawl your URL again. You can use the Azure AI Search index directly and delete the storage container to free up your storage space.
273+
# [Elasticsearch](#tab/elasticsearch)
231274

232275
---
233276

@@ -408,58 +451,6 @@ While Power Virtual Agents has features that leverage Azure OpenAI such as [gene
408451
> Deploying to Power Virtual Agents from Azure OpenAI is only available to US regions.
409452
> Power Virtual Agents supports Azure AI Search indexes with keyword or semantic search only. Other data sources and advanced features might not be supported.
410453
411-
#### Using the web app
412-
413-
You can also use the available standalone web app to interact with your model using a graphical user interface, which you can deploy using either Azure OpenAI studio or a [manual deployment](https://github.com/microsoft/sample-app-aoai-chatGPT).
414-
415-
![A screenshot of the web app interface.](../media/use-your-data/web-app.png)
416-
417-
##### Web app customization
418-
419-
You can also customize the app's frontend and backend logic. For example, you could change the icon that appears in the center of the app by updating `/frontend/src/assets/Azure.svg` and then redeploying the app [using the Azure CLI](https://github.com/microsoft/sample-app-aoai-chatGPT#deploy-with-the-azure-cli). See the source code for the web app, and more information [on GitHub](https://github.com/microsoft/sample-app-aoai-chatGPT).
420-
421-
When customizing the app, we recommend:
422-
423-
- Resetting the chat session (clear chat) if the user changes any settings. Notify the user that their chat history will be lost.
424-
425-
- Clearly communicating the effect on the user experience that each setting you implement will have.
426-
427-
- When you rotate API keys for your Azure OpenAI or Azure AI Search resource, be sure to update the app settings for each of your deployed apps to use the new keys.
428-
429-
- Pulling changes from the `main` branch for the web app's source code frequently to ensure you have the latest bug fixes and improvements.
430-
431-
##### Important considerations
432-
433-
- Publishing creates an Azure App Service in your subscription. It might incur costs depending on the [pricing plan](https://azure.microsoft.com/pricing/details/app-service/windows/) you select. When you're done with your app, you can delete it from the Azure portal.
434-
- By default, the app will only be accessible to you. To add authentication (for example, restrict access to the app to members of your Azure tenant):
435-
436-
1. Go to the [Azure portal](https://portal.azure.com/#home) and search for the app name you specified during publishing. Select the web app, and go to the **Authentication** tab on the left navigation menu. Then select **Add an identity provider**.
437-
438-
:::image type="content" source="../media/quickstarts/web-app-authentication.png" alt-text="Screenshot of the authentication page in the Azure portal." lightbox="../media/quickstarts/web-app-authentication.png":::
439-
440-
1. Select Microsoft as the identity provider. The default settings on this page will restrict the app to your tenant only, so you don't need to change anything else here. Then select **Add**
441-
442-
Now users will be asked to sign in with their Microsoft Entra account to be able to access your app. You can follow a similar process to add another identity provider if you prefer. The app doesn't use the user's sign-in information in any other way other than verifying they are a member of your tenant.
443-
444-
### Chat history
445-
446-
You can enable chat history for your users of the web app. If you enable the feature, your users will have access to their individual previous queries and responses.
447-
448-
To enable chat history, deploy or redeploy your model as a web app using [Azure OpenAI Studio](https://oai.azure.com/portal)
449-
450-
:::image type="content" source="../media/use-your-data/enable-chat-history.png" alt-text="A screenshot of the chat history enablement button on Azure OpenAI studio." lightbox="../media/use-your-data/enable-chat-history.png":::
451-
452-
> [!IMPORTANT]
453-
> Enabling chat history will create a [Cosmos DB](/azure/cosmos-db/introduction) instance in your resource group, and incur [additional charges](https://azure.microsoft.com/pricing/details/cosmos-db/autoscale-provisioned/) for the storage used.
454-
455-
Once you've enabled chat history, your users will be able to show and hide it in the top right corner of the app. When the history is shown, they can rename, or delete conversations. As they're logged into the app, conversations will be automatically ordered from newest to oldest, and named based on the first query in the conversation.
456-
457-
:::image type="content" source="../media/use-your-data/web-app-chat-history.jpg" alt-text="A screenshot of the chat history in the web app." lightbox="../media/use-your-data/web-app-chat-history.jpg":::
458-
459-
#### Deleting your Cosmos DB instance
460-
461-
Deleting your web app does not delete your Cosmos DB instance automatically. To delete your Cosmos DB instance, along with all stored chats, you need to navigate to the associated resource in the [Azure portal](https://portal.azure.com) and delete it. If you delete the Cosmos DB resource but keep the chat history option enabled on the studio, your users will be notified of a connection error, but can continue to use the web app without access to the chat history.
462-
463454
### Using the API
464455

465456
After you upload your data through Azure OpenAI studio, you can make a call against Azure OpenAI models through APIs. Consider setting the following parameters even if they are optional for using the API.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: 'Use a web app with Azure OpenAI Service'
3+
titleSuffix: Azure OpenAI
4+
description: Use this article to learn about using the provided web app to chat with Azure OpenAI models.
5+
#services: cognitive-services
6+
manager: nitinme
7+
ms.service: azure-ai-openai
8+
ms.topic: quickstart
9+
author: aahill
10+
ms.author: aahi
11+
ms.date: 01/09/2023
12+
recommendations: false
13+
---
14+
15+
# Use a web app with Azure OpenAI
233 KB
Loading

articles/ai-services/openai/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ items:
8686
href: ./how-to/work-with-code.md
8787
- name: Use with large datasets
8888
href: ./how-to/integrate-synapseml.md
89+
- name: Use a web app
90+
href: ./how-to/use-web-app.md
8991
- name: Content filtering
9092
href: ./how-to/content-filters.md
9193
- name: Use blocklists

0 commit comments

Comments
 (0)