Edit

Azure OpenAI vectorizer

The Azure OpenAI vectorizer connects to an embedding model deployed to your Azure OpenAI in Foundry Models resource or Microsoft Foundry project to generate embeddings at query time. Your data is processed in the Geo where your model is deployed.

Although vectorizers are used at query time, you specify them in index definitions and reference them on vector fields through a vector profile. For more information, see Configure a vectorizer in a search index.

The Azure OpenAI vectorizer is called AzureOpenAIVectorizer in the REST API. Use the latest stable version of Indexes - Create (REST API) or an Azure SDK package that provides the feature.

Note

This vectorizer is bound to Azure OpenAI and is charged at the Azure OpenAI Standard price.

Prerequisites

  • An Azure OpenAI in Foundry Models resource or Foundry project.

    • Your Azure OpenAI resource must have a custom subdomain, such as https://<resource-name>.openai.azure.com. You can find this endpoint on the Keys and Endpoint page in the Azure portal and use it for the resourceUri property in this skill.

    • The parent resource of your Foundry project provides access to multiple endpoints, including https://<resource-name>.openai.azure.com, https://<resource-name>.services.ai.azure.com, and https://<resource-name>.cognitiveservices.azure.com. You can find these endpoints on the Keys and Endpoint page in the Azure portal and use any of them for the resourceUri property in this skill.

  • An Azure OpenAI embedding model deployed to your resource or project. For supported models, see the next section.

Vectorizer parameters

Parameters are case sensitive.

Parameter name Description
resourceUri (Required) The URI of the model provider. Supported domains are:

  • openai.azure.com
  • services.ai.azure.com
  • cognitiveservices.azure.com

Azure API Management endpoints are supported with URL https://<resource-name>.azure-api.net. Shared private links aren't supported for API Management endpoints.

apiKey The secret key used to access the model. If you provide a key, leave authIdentity empty. If you set both apiKey and authIdentity, the apiKey is used on the connection.
deploymentId (Required) The ID of the deployed Azure OpenAI embedding model. This is the deployment name you specified when you deployed the model.
authIdentity A user-managed identity used by the search service for the connection. You can use either a system- or user-managed identity. To use a system-managed identity, leave apiKey and authIdentity blank. The system-managed identity is used automatically. A managed identity must have Cognitive Services OpenAI User permissions to send text to Azure OpenAI.
modelName (Required) The name of the Azure OpenAI model deployed at the specified deploymentId. Supported values are:

  • text-embedding-ada-002
  • text-embedding-3-large
  • text-embedding-3-small

Supported vector query types

The Azure OpenAI vectorizer only supports text vector queries.

Expected field dimensions

The expected field dimensions for a field configured with an Azure OpenAI vectorizer depend on the modelName that is configured.

modelName Minimum dimensions Maximum dimensions
text-embedding-ada-002 1536 1536
text-embedding-3-large 1 3072
text-embedding-3-small 1 1536

Sample definition

"vectorizers": [
    {
        "name": "my-openai-vectorizer",
        "kind": "azureOpenAI",
        "azureOpenAIParameters": {
            "resourceUri": "https://my-fake-azure-openai-resource.openai.azure.com",
            "apiKey": "0000000000000000000000000000000000000",
            "deploymentId": "my-ada-002-deployment",
            "authIdentity": null,
            "modelName": "text-embedding-ada-002",
        },
    }
]

Best practices

The following are some best practices you need to consider when utilizing this vectorizer:

  • If you are hitting your Azure OpenAI TPM (Tokens per minute) limit, consider the quota limits advisory so you can address accordingly. Refer to the Azure OpenAI monitoring documentation for more information about your Azure OpenAI instance performance.

  • The Azure OpenAI embeddings model deployment you use for this vectorizer should be ideally separate from the deployment used for other use cases, including the embedding skill. This helps each deployment to be tailored to its specific use case, leading to optimized performance and identifying traffic from the indexer and the index embedding calls easily.

  • Your Azure OpenAI instance should be in the same region or at least geographically close to the region where your AI Search service is hosted. This reduces latency and improves the speed of data transfer between the services.

  • To avoid experiencing 429 error codes often, consider implementing load balancing via API Management by implementing a gateway [/azure/architecture/ai-ml/guide/azure-openai-gateway-multi-backend] in front of multiple Azure OpenAI embedding model deployments.

  • If you have a larger than default Azure OpenAI TPM (Tokens per minute) limit as published in quotas and limits documentation, open a support case with the Azure AI Search team, so this can be adjusted accordingly. This helps your indexing process not being unnecessarily slowed down by the documented default TPM limit, if you have higher limits.

See also