Could not complete vectorization action. The vectorization endpoint returned status code '401' (Unauthorized).

Tho Le 35 Reputation points
2024-09-12T07:37:12.01+00:00

I am having the issue when vector querying an index in Azure AI Search. The error message is:

Could not complete vectorization action. The vectorization endpoint returned status code '401' (Unauthorized).

I've checked both my AI Search and Azure OpenAI; both are enabled with public access.

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,339 questions
{count} vote

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2024-09-18T06:45:33.7266667+00:00

    @Tho Le Glad that you were able to resolve your issue and I appreciate your effort in sharing the solution. Your contribution will undoubtedly assist others facing similar challenges.

    As the [Microsoft Q&A community follows a policy where the question author cannot accept their own answer] {https://learn.microsoft.com/en-us/answers/support/accept-answer} ,

    I've reposted your solution.  Feel free to consider "Accepting" the answer if you find it suitable.

    Resolution-

    • Enable public access on both Azure AI Search and Azure OpenAI.
    • In Azure OpenAI access control, add Azure AI Search as a Cognitive Service OpenAI Contributor role.
    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Lukáš Papík 5 Reputation points
    2025-03-13T10:36:19.6433333+00:00

    I followed the accepted answer, but I was still encountering the 401 error.

    In my case the problem was solved by checking the vectorizer configuration. I had to set the "Model deployment" option and save it (even though it was specified in my JSON config).

    However, when I reopen the vectorizer configuration, the model name is still not displayed.

    1 person found this answer helpful.
    0 comments No comments

  2. Heidi Steen 96 Reputation points Microsoft Employee
    2025-01-31T01:25:57.6733333+00:00

    You should be able to assign "Cognitive Service OpenAI User" role and still get access to the embedding model. This worked for me, and it's better to go with least privileges as a best practice.

    0 comments No comments

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.