Getting Service request failed. 404 (Not Found) error while calling azure vision ocr running in a docker container

kushal kaleshwari 1 Reputation point
2025-01-16T15:47:59.9133333+00:00

Getting Service request failed. 404 (Not Found) error while calling azure vision ocr running in a docker container. Everything works fine if I make a call to azure vision cloud ocr service.

I'm using endpoint "http://localhost:5000" for container call. When I enter this url in browser, it shows "Your Azure Cognitive Service Container is up and running" page with samples etc.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
727 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Amira Bedhiafi 28,381 Reputation points
    2025-01-16T16:32:08.09+00:00

    Try to check the exact API path you are calling. For example:

    • Cloud OCR: https://<your-cognitive-service-endpoint>/vision/v3.2/read/analyze
    • Container OCR might require something like /vision/v3.2/read/analyze
    • Verify the path /vision/v3.2/read/analyze or the equivalent for the version of the container you're using is appended to http://localhost:5000
    http://localhost:5000/vision/v3.2/read/analyze
    

    You can use the Docker logs to see what is happening within the container when the request is made.

    docker logs <container-id>
    
    0 comments No comments

  2. Nikhil Duserla 4,285 Reputation points Microsoft Vendor
    2025-02-05T12:24:30.7666667+00:00

    Hi @kushal kaleshwari,

    Good catch! Glad the issue is resolved for you finally.

    I will have this answer promoted by reposting it. As an Original Poster (You) will not be able to accept your own answer. This is in the attempt to help others looking for a solution for a similar issue.

    As container supports /vision/v3.2/read/syncAnalyze path and not /computervision/imageanalysis:analyze supported by cloud API call. With this change, the call is going through successfully now.

    Thanks again for sharing the solution here. Have a good day! User's image

    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.