How to fix : Unauthorized to access Form Recognizer resource, Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.

Tamilarasu Saravanakangeyan 0 Reputation points
2024-06-06T05:29:42.24+00:00

on-Prem hosted Azure Document intelligence studio Run Analysis request failing with 401 Unauthorized access.

Unauthorized to access Form Recognizer resource

Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.Click Switch Resource to use another Form Recognizer resource.

Identification: Ocp-Apim-Subscription-Key, Edit: XHR request and append ApiKey -> getting 204. So Ocp-Apim-Subscription-Key configuration is missing. No documentation available in terms of configuring Ocp-Apim-Subscription-Key in .env or nginx proxy

User's image

need inputs to resolve the same.

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,711 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Tamilarasu Saravanakangeyan 0 Reputation points
    2024-06-07T05:27:52.8533333+00:00

    Sheng & Eric, thanks for inputs. I found the exact route cause, technically the request should not be routed(Configure service resource-> Form Recognizer Service endpoint) to cloud endpoint, rather it should be point to custom-template-3 image port(highlighted in yellow)

    User's image

    0 comments No comments

  2. santoshkc 9,240 Reputation points Microsoft Vendor
    2024-06-07T11:10:10.55+00:00

    Hi @Tamilarasu Saravanakangeyan,

    I'm glad to hear that your issue has been resolved. And thanks for sharing the solution, which might be beneficial to other community members reading this thread as solution. Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Question title: How to fix : Unauthorized to access Form Recognizer resource, Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.

    Solution: Technically the request should not be routed (Configure service resource-> Form Recognizer Service endpoint) to cloud endpoint, rather it should be point to custom-template-3 image port (highlighted in yellow)

    User's image

    If you encounter any issues in the future, don't hesitate to reach out to the community forum for assistance. Thank you.


    Do not forget to click Accept Answer and Yes.


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.