azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

begin_analyze_document_from_url / prebuilt-invoice / InvalidContent / Azurite

Open Ioannis-Pikoulis opened this issue 2 years ago • 7 comments

I'm trying to debug a python Azure Function App locally. I've activated Azurite and uploaded a pdf file within the storage emulator. When running the app, I'm trying to apply begin_analyze_document_from_url using the DocumentAnalysisClient class. I get the InvalidContent error. I've also tried to use SAS token but no success whatsoever.

Ioannis-Pikoulis avatar Dec 03 '23 14:12 Ioannis-Pikoulis

Hi @Ioannis-Pikoulis - Thanks for opening an issue. Would you be able to provide the following information as well?

  • Package Name
  • Package Version
  • Python Version
  • Steps/Code snippet to reproduce behavior
  • Error Stack Trace

swathipil avatar Dec 04 '23 22:12 swathipil

Hi @Ioannis-Pikoulis , you don't need to pass SAS token URL when analyzing a doc. Additionally, we have an example that you can follow: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/formrecognizer/azure-ai-formrecognizer/samples/v3.2_and_later/sample_analyze_receipts_from_url.py#L42

YalinLi0312 avatar Dec 14 '23 01:12 YalinLi0312

Hi @Ioannis-Pikoulis. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar Dec 14 '23 01:12 github-actions[bot]

Hi @Ioannis-Pikoulis, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar Dec 21 '23 03:12 github-actions[bot]

@YalinLi0312 I have followed all given samples and examples: The problem is that when using begin_analyze_document_from_url on top of a URL that points to storage emulator (http://127.0.0.1:10000/devstoreaccount1), the function returns InvalidContent error. This basically renders local debugging sessions impossible, when trying to use DocumentAnalysisClient.

azure-ai-formrecognizer==3.3.2

Ioannis-Pikoulis avatar Dec 29 '23 11:12 Ioannis-Pikoulis

@Ioannis-Pikoulis There are several possibilities, it could because the document content is invalid, or something wrong to get the document content. Did you try with a file stored in local instead from Storage? It could help to figure out where the issue comes from.

Also, can you provide more details which would help us to investigate?

  • Steps/Code snippet to reproduce behavior
  • Error Stack Trace

YalinLi0312 avatar Jan 10 '24 01:01 YalinLi0312

Hi @Ioannis-Pikoulis. Thank you for opening this issue and giving us the opportunity to assist. To help our team better understand your issue and the details of your scenario please provide a response to the question asked above or the information requested above. This will help us more accurately address your issue.

github-actions[bot] avatar Jan 10 '24 01:01 github-actions[bot]

Hi @Ioannis-Pikoulis, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

github-actions[bot] avatar Jan 17 '24 03:01 github-actions[bot]