I'm receiving a "401 Access Denied due to invalid subscription key or wrong API endpoint" message when trying to run the Form Recognizer Studio in a container?

Marques Chacon 0 Reputation points
2024-12-23T19:04:45.88+00:00

I used the following link to learn how to run and configure containers for Azure AI Document Intelligence. Specifically, I created the requisite files and folders needed for the Custom container, then pulled and ran the images using docker compose as they specify. I am able to pull up Form Recognizer Studio, and I am able to navigate to Custom Extraction models, create a project, specify the endpoint, and see the loaded images based on the image path I specified in my .env file. However, when I try to analyze an image, I receive an error (see below).

User's image

I am positive that my endpoint and key (as specified in the .env file) are correct, because when I tried a direct API call in Python (I instantiated a DocumentIntelligenceClient and used the same endpoint and key), it performed the operation that I wanted. I didn't specify any API version though.

What could be the issue for this? I noticed that the versions from the guide for layout and custom-template are 3.1 but studio was 3.0. I tried making them all 3.0 but that didn't fix the issue. I also notice that I am using "Document Intelligence Studio" when using the Azure console, but the container I have is for "Form Recognizer Studio". Could it be due to the migration to "Document Intelligence Studio"?

Any help would be highly appreciated.

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

1 answer

Sort by: Most helpful
  1. Azar 24,600 Reputation points MVP
    2024-12-23T19:39:34.09+00:00

    Hi there Marques Chacon

    Thanks for using QandA platform

    Check these ones just to make sure,

    Firstly try regenerating the keys and try again.

    Double-check the API version compatibility across the container, endpoint, and subscription key.

    Verify and update the container image to the latest version.

    Ensure the .env file is correctly formatted and has no errors.

    Cross-check the region and network settings. (check region mismatch -if the container is configured to point to an endpoint in a different region than your Azure resource.

    If nothing works i suggest you to raise a support req kink below

    https://portal.azure.com/#view/Microsoft_Azure_Support/HelpAndSupportBlade/~/overview

    If this helps kindly accept the answer thanks much.


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.