Azure Document Intelligence Python API - extract text from PDF - error 404

Miquel 0 Puntos de reputación
2025-04-15T19:32:06.3333333+00:00

Hi,

I am trying to use the Document Intelligence Python API to extract the content from a PDF file. I followed the step by step guide provided by Azure (here: https://learn.microsoft.com/es-es/azure/ai-services/document-intelligence/quickstarts/get-started-sdks-rest-api?view=doc-intel-4.0.0&pivots=programming-language-python), installing packages, copying api key and endpoint from the right location and resource but I am unable to get make the script work.

I even tried with the example Azure provides (here: https://github.com/Azure-Samples/document-intelligence-code-samples/blob/main/Python(v4.0)/Layout_model/sample_analyze_layout.py) with sample-layout pdf from Azure github and still I get the error:

azure.core.exceptions.ResourceNotFoundError: (404) Resource not found

Code: 404

Message: Resource not found

If someone knows how to solve this issue please I appreciate the help a lot!

Best regards

Azure
Azure
Plataforma e infraestructura de informática en la nube para crear, implementar y administrar aplicaciones y servicios a través de una red mundial de centros de datos administrados por Microsoft.
595 preguntas
{count} votos

2 respuestas

Ordenar por: Muy útil
  1. Miquel 0 Puntos de reputación
    2025-04-16T09:53:58.1166667+00:00

    Hi Ravada!

    Gotcha, I see our Document Intelligence service is located in Sweden Central. Is it possible to move the location or we have to create a new resource for the right loccation?

    Thanks a lot for the help

    Best,


  2. Miquel 0 Puntos de reputación
    2025-04-16T10:08:59.9266667+00:00

    One more question, I observed that is only extracting 2 pages from the PDF, I tried to modify the pages parameter on 'begin_analyze_document' method to a string range like 1-10 but it's not working. What's the correct format to specify a range of pages?

    Thank you a lot

    Best


Su respuesta

Las respuestas se pueden marcar como respuestas aceptadas por el autor de la pregunta, lo que ayuda a los usuarios a conocer la respuesta que resolvió el problema del autor.