Azure OpenAI vectorizer

Note

Foundry IQ (Azure AI Search) provides direct indexing and query APIs alongside higher-level knowledge source and knowledge base APIs for managed retrieval. Use the Azure portal, REST APIs, or Azure SDKs to configure these capabilities, or connect agents to knowledge bases in the Microsoft Foundry portal.

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 model resource base URI. Supported resource domains are:

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

Azure API Management (APIM) Premium v2 HTTPS gateway base URIs are also supported, including default azure-api.net hosts and configured custom domains. Set deploymentId separately; don't supply a complete embeddings operation URL. For routing, authentication, RBAC, and private-connectivity qualifications, see Use API Management with Foundry IQ (Azure AI Search) model calls.

apiKey The secret key used to access the model. Configure only one authentication method; when using a key, leave authIdentity empty.
deploymentId (Required) The ID of the deployed Azure OpenAI embedding model. This is the deployment name you specified when you deployed the model.
authIdentity The user-assigned managed identity used for the connection. Omit both apiKey and authIdentity to use the Foundry IQ service's system-assigned identity. For direct calls or token pass-through, assign Cognitive Services OpenAI User on the model-hosting Azure OpenAI or parent Foundry resource. For identity selection and separate gateway/backend assignments, see Role scope and identity identifiers.
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.

For API Management endpoint, authentication, and private-network requirements, see Use API Management with Foundry IQ model calls.

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

The following index definition fragment configures a direct Azure OpenAI connection. Replace <api-key> with your credential before sending the request.

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

API Management custom-domain example

This index definition fragment configures a vectorizer with an API Management custom gateway domain and the Foundry IQ service's system-assigned identity. Replace the hostname and deployment name with your values. To use the default gateway domain instead, set resourceUri to https://<apim-name>.azure-api.net.

{
  "vectorizers": [
    {
      "name": "apim-embedding",
      "kind": "azureOpenAI",
      "azureOpenAIParameters": {
        "resourceUri": "https://apim.contoso.com",
        "deploymentId": "my-text-embedding-3-small",
        "modelName": "text-embedding-3-small"
      }
    }
  ]
}

Reference: Indexes - Create.

Select this vectorizer in a vector profile that matches the embedding model used at indexing time. To select an attached user-assigned Search identity instead, add the following object inside azureOpenAIParameters:

{
  "authIdentity": {
    "@odata.type": "#Microsoft.Azure.Search.DataUserAssignedIdentity",
    "userAssignedIdentity": "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity-name>"
  }
}

For key authentication, supply apiKey and omit authIdentity; Search sends the key in the api-key header. Configure the gateway for the native embedding route and authentication.

Performance 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 Foundry IQ service is hosted. This reduces latency and improves the speed of data transfer between the services.

  • To avoid frequent 429 error codes, consider implementing load balancing through API Management by implementing a load-balancing gateway 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 Foundry IQ 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.

Security considerations for managed identity authentication

When the Azure OpenAI vectorizer uses managed identity, Foundry IQ sends a Microsoft Entra access token for the Cognitive Services audience (https://cognitiveservices.azure.com) and the query text to the endpoint configured in resourceUri. This process applies when you select a user-assigned identity with authIdentity or omit both apiKey and authIdentity to use the system-assigned identity.

Configure only endpoints you trust and control and that are intended to receive both the token and the text. A hostname alone doesn't establish ownership or trust. Don't rely on a connection check to establish that an API Management gateway fronts a resource you own.

Configure the receiving endpoint to validate the token's signature and standard claims, including issuer, audience, tenant, lifetime, and required permissions. Apply least privilege to the Foundry IQ service's managed identity. For gateway setup and the separate API Management-to-backend identity, see Use API Management with Foundry IQ model calls.

Note

A managed identity token issued for the Foundry Tools audience is valid against any Foundry Tools or Azure OpenAI resource the identity is authorized on. Sending it to an untrusted endpoint could expose the token.

To help maintain a secure deployment, follow these practices:

  • Set resourceUri only to endpoints you own and trust. Use the resource domains in Vectorizer parameters. If you use an APIM endpoint, confirm its routing before enabling managed identity. A trusted-looking hostname isn't proof of ownership.
  • Apply least privilege to each connection. For direct Azure OpenAI calls or intentional token pass-through, grant the selected Search identity Cognitive Services OpenAI User on the Azure OpenAI or parent Foundry resource hosting the deployment. When APIM terminates Search authentication and uses its own identity, authorize Search at APIM and grant that backend role to APIM's identity on the model-hosting resource, not Search. Avoid broader roles.
  • Evaluate Network Security Perimeter (NSP) and private connectivity for the specific workload. A private endpoint or VNet integration on the receiver alone doesn't provision a route from the query execution host.
  • If you use an APIM endpoint, ensure the gateway validates inbound requests and forwards them only to the intended backend. You should also review its access policies periodically.
  • Prefer managed identity over apiKey. If you use apiKey, store and rotate it securely and don't embed it in source control. Configure only one authentication method.
  • Periodically review index definitions, managed identity role assignments, and APIM configurations to confirm that resourceUri values, access controls, and identity permissions remain current and appropriate. Review configuration changes through your established change-management and security-review processes.
  • Monitor Azure OpenAI and Foundry Tools sign-in logs, authentication events, and access logs for unexpected or unauthorized activity.
  • Remove unused vectorizers, endpoints, role assignments, and API keys that are no longer required.

Restrict access to index and vectorizer configuration

Users who can create or modify index definitions control both the destination endpoint (resourceUri) and the authentication configuration used by the vectorizer. Because the vectorizer sends a managed identity token for the Cognitive Services audience to that endpoint, restrict these permissions to trusted administrators and follow your standard change-management and security-review processes when configuring managed identity–enabled vectorizers.

Don't assume the management setting properties.dataExfiltrationProtections: ["BlockAll"] disables every Azure OpenAI vectorizer. Restrict index-edit permissions and review destinations, gateway policies, and role assignments. For the same destination-trust responsibilities in indexing, see Custom Web API skill security considerations.

See also