What value do we provide in authidentity field in vectorizers while creating index or skillset?

imgkj 45 Reputation points
2024-10-23T09:32:54.56+00:00

I want create a index and skillset but while creating the index with JSON, I am not sure what value do I need to provide in vestorizers for authidentiy. I don't want to use api keys and am looking to use managed identity to serve the purpose. How do I proceed for this use case?

Can I use only authidentity and leave api keys blank in the JSON to achieve this? if yes, what value I can provie in authidentity field? Please share any example to understand this if possible.

Here's the snippet of the reference JSON from MS learn portal.User's image

I want to know how to provide this authidentity field value and will this work if I remove the api key or leave it blank. I just want to use managed identity for this.

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,358 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,656 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 34,656 Reputation points Volunteer Moderator
    2024-10-27T17:47:00.9433333+00:00

    In Azure AI Search, to use managed identity instead of an API key in vectorizers, you can indeed use the authIdentity field, while omitting the apiKey. To do this, specify authIdentity with the value ManagedIdentity. :

    
    {
    
        "profiles": [
    
            {
    
                "name": "vector-nasa-ebook-text-profile",
    
                "algorithm": "vector-nasa-ebook-text-algorithm",
    
                "vectorizer": "vector-nasa-ebook-text-vectorizer"
    
            }
    
        ],
    
        "vectorizers": [
    
            {
    
                "name": "vector-nasa-ebook-text-vectorizer",
    
                "kind": "azureOpenAI",
    
                "azureOpenAIParameters": {
    
                    "resourceUri": "https://my-fake-azure-openai-resource.openai.azure.com/",
    
                    "deploymentId": "text-embedding-ada-002",
    
                    "modelName": "text-embedding-ada-002",
    
                    "authIdentity": "ManagedIdentity"
    
                },
    
                "customWebApiParameters": null
    
            }
    
        ]
    
    }
    
    

    But before verify that the managed identity you are using has the necessary permissions on the Azure OpenAI resource. Usually, this requires at least the "Cognitive Services User" role on the target resource.

    The apiKey can be omitted or left as null when authIdentity is set to ManagedIdentity.

    For further guidance, you can refer to the Azure Cognitive Search documentation or the Azure OpenAI integration guides.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.