How to feed document url to azure form recognizer api in python?

Anvesh Muttavarapu 0 Reputation points
2023-09-22T16:48:08.23+00:00

I used from DocumentAnalysisClient in azure.ai.formrecognizer. It has a function called "begin_analyze_document_from_url" (ref: https://learn.microsoft.com/en-us/python/api/overview/azure/ai-formrecognizer-readme?view=azure-python) . this function always throws error for any document url.
Code:
poller = document_analysis_client.begin_analyze_document_from_url(model_id="prebuilt-read", document_url=form_url)

result = poller.result()
Below is the error. Is this a known issue. please let me know how to resolve this.

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 Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,718 questions
{count} votes

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.