How to fix 'InvalidContent' error in ID_Document model for Document Intelligence

Hani Shaikh 0 Reputation points
2023-10-09T23:31:14.34+00:00

I am trying to use the ID Document model in Document Intelligence python code to analyze the passport and retrieve its details. The file is in valid jpg format. I even tried with png.

When I use the passport photo in Document Intelligence Studio it picks up the details. But when using the python code in my application as documented here https://learn.microsoft.com/en-us/azure/ai-services/document-intelligence/how-to-guides/use-sdk-rest-api?view=doc-intel-3.1.0&tabs=windows&pivots=programming-language-python#use-the-id-document-model I keep seeing this error:

  File "C:\Users\hanis\AppData\Local\Programs\Python\Python312\Lib\site-packages\azure\ai\formrecognizer\_generated\v2023_07_31\operations\_document_models_operations.py", line 443, in _analyze_document_initial
    raise HttpResponseError(response=response)
azure.core.exceptions.HttpResponseError: (InvalidRequest) Invalid request.
Code: InvalidRequest
Message: Invalid request.
Inner error: {
    "code": "InvalidContent",
    "message": "The file is corrupted or format is unsupported. Refer to documentation for the list of supported formats."
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,396 questions
{count} votes