Set up integrated vectorization in Azure AI Search using REST

In this article, you learn how to use a skillset to chunk and vectorize content from a supported data source. The skillset calls the Text Split skill or Document Layout skill for chunking and an embedding skill that's attached to a supported embedding model for chunk vectorization. You also learn how to store the chunked and vectorized content in a vector index.

This article describes the end-to-end workflow for integrated vectorization using REST. For portal-based instructions, see Quickstart: Vectorize text and images in the Azure portal.

Prerequisites

Supported data sources

Integrated vectorization works with all supported data sources. However, this article focuses on the most commonly used data sources, which are described in the following table.

Supported data source Description
Azure Blob Storage This data source works with blobs and tables. You must use a standard performance (general-purpose v2) account. Access tiers can be hot, cool, or cold.
Azure Data Lake Storage (ADLS) Gen2 This is an Azure Storage account with a hierarchical namespace enabled. To confirm that you have Data Lake Storage, check the Properties tab on the Overview page.

Screenshot of an Azure Data Lake Storage account in the Azure portal.

Supported embedding models

For integrated vectorization, you must use one of the following embedding models on an Azure AI platform. Deployment instructions are provided in a later section.

Provider Supported models
Azure OpenAI in Azure AI Foundry Models 1, 2 text-embedding-ada-002
text-embedding-3-small
text-embedding-3-large
Azure AI services multi-service resource 3 For text and images: Azure AI Vision multimodal 4

1 The endpoint of your Azure OpenAI resource must have a custom subdomain, such as https://my-unique-name.openai.azure.com. If you created your resource in the Azure portal, this subdomain was automatically generated during resource setup.

2 Azure OpenAI resources (with access to embedding models) that were created in the Azure AI Foundry portal aren't supported. Only Azure OpenAI resources created in the Azure portal are compatible with the Azure OpenAI Embedding skill.

3 For billing purposes, you must attach your Azure AI multi-service resource to the skillset in your Azure AI Search service. Unless you use a keyless connection (preview) to create the skillset, both resources must be in the same region.

4 The Azure AI Vision multimodal embedding model is available in select regions.

Role-based access

You can use Microsoft Entra ID with role assignments or key-based authentication with full-access connection strings. For Azure AI Search connections to other resources, we recommend role assignments.

To configure role-based access for integrated vectorization:

  1. On your search service, enable roles and configure a system-assigned managed identity.

  2. On your data source platform and embedding model provider, create role assignments that allow your search service to access data and models. See Prepare your data and Prepare your embedding model.

Note

Free search services support role-based connections to Azure AI Search. However, they don't support managed identities on outbound connections to Azure Storage or Azure AI Vision. This lack of support requires key-based authentication on connections between free search services and other Azure resources.

For more secure connections, use the Basic tier or higher. You can then enable roles and configure a managed identity for authorized access.

In this section, you retrieve the endpoint and Microsoft Entra token for your Azure AI Search service. Both values are necessary to establish connections in REST requests.

Tip

The following steps assume that you're using role-based access for proof-of-concept testing. If you want to use integrated vectorization for app development, see Connect your app to Azure AI Search using identities.

  1. Sign in to the Azure portal and select your Azure AI Search service.

  2. To obtain your search endpoint, copy the URL on the Overview page. An example search endpoint is https://my-service.search.azure.cn.

  3. To obtain your Microsoft Entra token, run the following command on your local system. This step requires completion of Quickstart: Connect without keys.

    az account get-access-token --scope https://search.azure.com/.default --query accessToken --output tsv
    

Prepare your data

In this section, you prepare your data for integrated vectorization by uploading files to a supported data source, assigning roles, and obtaining connection information.

  1. Sign in to the Azure portal and select your Azure Storage account.

  2. From the left pane, select Data storage > Containers.

  3. Create a container or select an existing container, and then upload your files to the container.

  4. To assign roles:

    1. From the left pane, select Access Control (IAM).

    2. Select Add > Add role assignment.

    3. Under Job function roles, select Storage Blob Data Reader, and then select Next.

    4. Under Members, select Managed identity, and then select Select members.

    5. Select your subscription and the managed identity of your search service.

  5. To obtain a connection string:

    1. From the left pane, select Security + networking > Access keys.

    2. Copy either connection string, which you specify later in Set variables.

  6. (Optional) Synchronize deletions in your container with deletions in the search index. To configure your indexer for deletion detection:

    1. Enable soft delete on your storage account. If you're using native soft delete, the next step isn't required.

    2. Add custom metadata that an indexer can scan to determine which blobs are marked for deletion. Give your custom property a descriptive name. For example, you can name the property "IsDeleted" and set it to false. Repeat this step for every blob in the container. When you want to delete the blob, change the property to true. For more information, see Change and delete detection when indexing from Azure Storage.

Prepare your embedding model

In this section, you prepare your Azure AI resource for integrated vectorization by assigning roles, obtaining an endpoint, and deploying a supported embedding model.

Azure AI Search supports text-embedding-ada-002, text-embedding-3-small, and text-embedding-3-large. Internally, Azure AI Search calls the Azure OpenAI Embedding skill to connect to Azure operated by 21Vianet OpenAI.

  1. Sign in to the Azure portal and select your Azure OpenAI resource.

  2. To assign roles:

    1. From the left pane, select Access control (IAM).

    2. Select Add > Add role assignment.

    3. Under Job function roles, select Cognitive Services OpenAI User, and then select Next.

    4. Under Members, select Managed identity, and then select Select members.

    5. Select your subscription and the managed identity of your search service.

  3. To obtain an endpoint:

    1. From the left pane, select Resource Management > Keys and Endpoint.

    2. Copy the endpoint for your Azure OpenAI resource. You specify this URL later in Set variables.

  4. To deploy an embedding model:

    1. Sign in to the Azure AI Foundry portal and select your Azure OpenAI resource.

    2. From the left pane, select Model catalog.

    3. Deploy a supported embedding model.

    4. Copy the deployment and model names, which you specify later in Set variables. The deployment name is the custom name you chose, while the model name is the model you deployed, such as text-embedding-ada-002.