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: articles/search/tutorial-document-extraction-image-verbalization.md
+54-36Lines changed: 54 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,15 +43,17 @@ This tutorial demonstrates a lower-cost approach for indexing multimodal content
43
43
44
44
+[Azure Storage](/azure/storage/common/storage-account-create), used for storing sample data and for creating a [knowledge store](knowledge-store-concept-intro.md).
45
45
46
-
+[Azure OpenAI](/azure/ai-foundry/openai/how-to/create-resource) with a deployment of a chat completion model hosted in Azure AI Foundry or another source. The model is used to verbalize image content. You provide the URI to the hosted model in the GenAI Prompt skill definition.
46
+
+[Azure OpenAI](/azure/ai-foundry/openai/how-to/create-resource) with a deployment of
47
47
48
-
+ A text embedding model deployed in Azure AI Foundry. The model is used to vectorize text content pull from source documents and the image descriptions generated by the chat completion model. For integrated vectorization, the embedding model must be located in Azure AI Foundry, and it must be either text-embedding-ada-002, text-embedding-3-large, or text-embedding-3-small. If you want to use an external embedding model, use a custom skill instead of the Azure OpenAI embedding skill.
48
+
+ A chat completion model hosted in Azure AI Foundry or another source. The model is used to verbalize image content. You provide the URI to the hosted model in the GenAI Prompt skill definition. You can use [any chat completion model](cognitive-search-skill-genai-prompt.md#supported-models).
49
+
50
+
+ A text embedding model deployed in Azure AI Foundry. The model is used to vectorize text content pull from source documents and the image descriptions generated by the chat completion model. For integrated vectorization, the embedding model must be located in Azure AI Foundry, and it must be either text-embedding-ada-002, text-embedding-3-large, or text-embedding-3-small. If you want to use an external embedding model, use a custom skill instead of the Azure OpenAI embedding skill.
49
51
50
52
+[Visual Studio Code](https://code.visualstudio.com/download) with a [REST client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client).
51
53
52
54
## Prepare data
53
55
54
-
The following instructions apply to Azure Storage which provides the sample data and also hosts the knowledge store. A search service identity needs read access to Azure Storage to retrieve the sample data, and it needs write access to create the knowledge store. The search service creates the container for cropped images during skillset processing.
56
+
The following instructions apply to Azure Storage which provides the sample data and also hosts the knowledge store. A search service identity needs read access to Azure Storage to retrieve the sample data, and it needs write access to create the knowledge store. The search service creates the container for cropped images during skillset processing, using the name you provide in an environment variable.
55
57
56
58
1. Download the following sample PDF: [sustainable-ai-pdf](https://cdn-dynmedia-1.microsoft.com/is/content/microsoftcorp/microsoft/msc/documents/presentations/CSR/Accelerating-Sustainability-with-AI-2025.pdf)
57
59
@@ -83,25 +85,35 @@ The following instructions apply to Azure Storage which provides the sample data
83
85
}
84
86
```
85
87
86
-
### Copy a search service URL and API key
88
+
## Prepare models
87
89
88
-
For this tutorial, your REST client connection to Azure AI Search requires an endpoint and an API key. You can get these values from the Azure portal. For alternative connection methods, see [Connect to a search service](search-get-started-rbac.md).
90
+
This tutorial assumes you have an existing Azure OpenAI resource through which the skills call the text embedding model and chat completion models. The search service connects to the models during skillset processing and during query execution using its managed identity. This section gives you guidance and links for assigning roles for authorized access.
89
91
90
-
1. Sign in to the [Azure portal](https://portal.azure.com), navigate to the search service **Overview** page, and copy the URL. An example endpoint might look like `https://mydemo.search.windows.net`.
92
+
1. Sign in to the Azure portal (not the Foundry portal) and find the Azure OpenAI resource.
91
93
92
-
1. Under **Settings** > **Keys**, copy an admin key. Admin keys are used to add, modify, and delete objects. There are two interchangeable admin keys. Copy either one.
94
+
1. Select **Access control (IAM)**.
93
95
94
-
:::image type="content" source="media/search-get-started-rest/get-url-key.png" alt-text="Screenshot of the URL and API keys in the Azure portal.":::
96
+
1. Select **Add** and then **Add role assignment**.
97
+
98
+
1. Search for **Cognitive Services OpenAI User** and then select it.
99
+
100
+
1. Choose **Managed identity** and then assign your [search service managed identity](search-howto-managed-identities-data-sources.md).
101
+
102
+
For more information, see [Role-based access control for Azure OpenAI in Azure AI Foundry Models](/azure/ai-foundry/openai/how-to/role-based-access-control).
95
103
96
104
## Set up your REST file
97
105
106
+
For this tutorial, your local REST client connection to Azure AI Search requires an endpoint and an API key. You can get these values from the Azure portal. For alternative connection methods, see [Connect to a search service](search-get-started-rbac.md).
107
+
108
+
For other authenticated connections, the search service uses the role assignments you previously defined.
109
+
98
110
1. Start Visual Studio Code and create a new file.
99
111
100
112
1. Provide values for variables used in the request.
@@ -110,19 +122,25 @@ For this tutorial, your REST client connection to Azure AI Search requires an en
110
122
@imageProjectionContainer=PUT-YOUR-IMAGE-PROJECTION-CONTAINER-HERE (Azure AI Search creates this container for you during skills processing)
111
123
```
112
124
113
-
1. Save the file using a `.rest` or `.http` file extension.
125
+
1. Save the file using a `.rest` or `.http` file extension. For help with the REST client, see [Quickstart: Full-text search using REST](search-get-started-text.md).
126
+
127
+
To get the Azure AI Search endpoint and API key:
128
+
129
+
1. Sign in to the [Azure portal](https://portal.azure.com), navigate to the search service **Overview** page, and copy the URL. An example endpoint might look like `https://mydemo.search.windows.net`.
114
130
115
-
For help with the REST client, see [Quickstart: Full-text search using REST](search-get-started-text.md).
131
+
1. Under **Settings** > **Keys**, copy an admin key. Admin keys are used to add, modify, and delete objects. There are two interchangeable admin keys. Copy either one.
132
+
133
+
:::image type="content" source="media/search-get-started-rest/get-url-key.png" alt-text="Screenshot of the URL and API keys in the Azure portal.":::
116
134
117
135
## Create a data source
118
136
119
137
[Create Data Source (REST)](/rest/api/searchservice/data-sources/create) creates a data source connection that specifies what data to index.
120
138
121
139
```http
122
140
### Create a data source
123
-
POST {{baseUrl}}/datasources?api-version=2025-05-01-preview HTTP/1.1
141
+
POST {{searchUrl}}/datasources?api-version=2025-05-01-preview HTTP/1.1
124
142
Content-Type: application/json
125
-
api-key: {{apiKey}}
143
+
api-key: {{searchApiKey}}
126
144
127
145
{
128
146
"name": "doc-extraction-image-verbalization-ds",
@@ -187,9 +205,9 @@ For nested JSON, the index fields must be identical to the source fields. Curren
187
205
188
206
```http
189
207
### Create an index
190
-
POST {{baseUrl}}/indexes?api-version=2025-05-01-preview HTTP/1.1
208
+
POST {{searchUrl}}/indexes?api-version=2025-05-01-preview HTTP/1.1
@@ -638,9 +656,9 @@ You can start searching as soon as the first document is loaded.
638
656
639
657
```http
640
658
### Query the index
641
-
POST {{baseUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
659
+
POST {{searchUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
642
660
Content-Type: application/json
643
-
api-key: {{apiKey}}
661
+
api-key: {{searchApiKey}}
644
662
645
663
{
646
664
"search": "*",
@@ -689,9 +707,9 @@ Here are some examples of other queries:
689
707
690
708
```http
691
709
### Query for only images
692
-
POST {{baseUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
710
+
POST {{searchUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
693
711
Content-Type: application/json
694
-
api-key: {{apiKey}}
712
+
api-key: {{searchApiKey}}
695
713
696
714
{
697
715
"search": "*",
@@ -702,9 +720,9 @@ POST {{baseUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?ap
702
720
703
721
```http
704
722
### Query for text or images with content related to energy, returning the id, parent document, and text (extracted text for text chunks and verbalized image text for images), and the content path where the image is saved in the knowledge store (only populated for images)
705
-
POST {{baseUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
723
+
POST {{searchUrl}}/indexes/doc-extraction-image-verbalization-index/docs/search?api-version=2025-05-01-preview HTTP/1.1
706
724
Content-Type: application/json
707
-
api-key: {{apiKey}}
725
+
api-key: {{searchApiKey}}
708
726
709
727
{
710
728
"search": "energy",
@@ -719,20 +737,20 @@ Indexers can be reset to clear the high-water mark, which allows a full rerun. T
719
737
720
738
```http
721
739
### Reset the indexer
722
-
POST {{baseUrl}}/indexers/doc-extraction-image-verbalization-indexer/reset?api-version=2025-05-01-preview HTTP/1.1
723
-
api-key: {{apiKey}}
740
+
POST {{searchUrl}}/indexers/doc-extraction-image-verbalization-indexer/reset?api-version=2025-05-01-preview HTTP/1.1
741
+
api-key: {{searchApiKey}}
724
742
```
725
743
726
744
```http
727
745
### Run the indexer
728
-
POST {{baseUrl}}/indexers/doc-extraction-image-verbalization-indexer/run?api-version=2025-05-01-preview HTTP/1.1
729
-
api-key: {{apiKey}}
746
+
POST {{searchUrl}}/indexers/doc-extraction-image-verbalization-indexer/run?api-version=2025-05-01-preview HTTP/1.1
747
+
api-key: {{searchApiKey}}
730
748
```
731
749
732
750
```http
733
751
### Check indexer status
734
-
GET {{baseUrl}}/indexers/doc-extraction-image-verbalization-indexer/status?api-version=2025-05-01-preview HTTP/1.1
735
-
api-key: {{apiKey}}
752
+
GET {{searchUrl}}/indexers/doc-extraction-image-verbalization-indexer/status?api-version=2025-05-01-preview HTTP/1.1
0 commit comments