404 (Resource Not Found) error on ImageAnalysisClient.Analyze method

NANDHAKUMAR MURUGESAN 20 Reputation points
2025-03-05T21:46:43.52+00:00

I tried AIVision to read captions, objects, texts on an image and I'm getting 404 (Resource Not Found) error on ImageAnalysisClient.Analyze method.

Here is the code

AIVision_Analyze_ErrorHere is the stack trace

Azure.RequestFailedException: Resource not found

Status: 404 (Resource Not Found)

ErrorCode: 404

Content:

{"error":{"code":"404","message": "Resource not found"}}

Headers:

apim-request-id: REDACTED

Strict-Transport-Security: REDACTED

X-Content-Type-Options: REDACTED

Date: Wed, 05 Mar 2025 20:45:40 GMT

Content-Length: 56

Content-Type: application/json

at Azure.Core.HttpPipelineExtensions.ProcessMessage(HttpPipeline pipeline, HttpMessage message, RequestContext requestContext, CancellationToken cancellationToken)

at Azure.AI.Vision.ImageAnalysis.ImageAnalysisClient.AnalyzeFromImageData(IEnumerable1 visualFeatures, RequestContent content, String language, Nullable1 genderNeutralCaption, IEnumerable`1 smartCropsAspectRatios, String modelVersion, RequestContext context)

at Azure.AI.Vision.ImageAnalysis.ImageAnalysisClient.AnalyzeFromImageData(IEnumerable1 visualFeatures, BinaryData imageData, String language, Nullable1 genderNeutralCaption, IEnumerable`1 smartCropsAspectRatios, String modelVersion, CancellationToken cancellationToken)

at Azure.AI.Vision.ImageAnalysis.ImageAnalysisClient.Analyze(BinaryData imageData, VisualFeatures visualFeatures, ImageAnalysisOptions options, CancellationToken cancellationToken)

at Program.<<main>$>g__AnalyzeImage|0_0() in C:\Nandha\R&D\AIVision\ConsoleApp2\ConsoleApp2\Program.cs:line 44

at Program.<main>$(String[] args) in C:\Nandha\R&D\AIVision\ConsoleApp2\ConsoleApp2\Program.cs:line 8

Thanks in advance for your help!

</main></main>

Azure AI Custom Vision
Azure AI Custom Vision
An Azure artificial intelligence service and end-to-end platform for applying computer vision to specific domains.
294 questions
{count} votes

Accepted answer
  1. JAYA SHANKAR G S 4,035 Reputation points Microsoft External Staff Moderator
    2025-03-19T03:33:19.76+00:00

    Hi @NANDHAKUMAR MURUGESAN ,

    First, get the endpoint from your computer vision resource in Keys and Endpoint under

    Resource Management.

    It will be something like below

    https://<resource_name>.cognitiveservices.azure.com

    User's image

    Next, if you are using sdk then just give the endpoint

    ImageAnalysisClient client = new ImageAnalysisClient(new Uri("https://<resource_name>.cognitiveservices.azure.com"), new AzureKeyCredential(aiSvcKey));
    

    If you are using postman to test then you use full rest Api.

    https://<resource_name>.cognitiveservices.azure.com/imageanalysis:analyze?api-version=2023-04-01-preview
    

    Storage account URL is not publicly accessible, try it in-cognition mode if is working, if not then create URL with SAS token.

    User's image

    Please try it and let me know if you have any query.

    Thank you

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.