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

NANDHAKUMAR MURUGESAN 0 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.
274 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pavankumar Purilla 4,355 Reputation points Microsoft External Staff
    2025-03-06T18:34:11.5066667+00:00

    Hi NANDHAKUMAR MURUGESAN,
    Greetings & Welcome to the Microsoft Q&A forum! Thank you for sharing your query. 

    The 404 (Resource Not Found) error in ImageAnalysisClient.Analyze is usually caused by an incorrect endpoint, invalid API key, or mismatched resource configuration. Ensure the endpoint URL matches your Azure AI Vision resource region and that you're using a valid API key. Also, verify that the correct Vision AI service is enabled in Azure.

    Check that your API call is correctly formatted, including parameters like imageData, visualFeatures, and options. If necessary, explicitly set the model version using options.ModelVersion = "latest";
    For more information: Azure Image Analysis client library for .NET - version 1.0.0-beta.3

    I hope this information helps.


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.