question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Getting error for FormRecognizerClient StartRecognizeCustomFormsFromUri for Azure SAS Uri

See original GitHub issue

Describe the bug I was trying to FormRecognizerClient.StartRecognizeCustomFormsFromUri() using a valid model id and SAS Uri, But getting BadRequest. But the same uri can be processed by form recognizer api.

Note that, Uri is valid and if I download data using WebClient and pass it as stream content to StartRecognizeCustomForms() then it works.

Expected behavior It should return the processed result.

Actual behavior (include Exception or Stack Trace)

Service request failed. Status: 400 (Bad Request) Content: {“error”:{“code”:“1003”,“message”:“Parameter ‘Source’ is not a valid Uri.”}}

Headers: Transfer-Encoding: chunked x-envoy-upstream-service-time: REDACTED apim-request-id: REDACTED Strict-Transport-Security: REDACTED X-Content-Type-Options: REDACTED Date: Fri, 24 Apr 2020 12:16:36 GMT Content-Type: application/json; charset=utf-8

| StackTrace | " at Azure.AI.FormRecognizer.ServiceRestClient.AnalyzeWithCustomModel(Guid modelId, Nullable`1 includeTextDetails, SourcePath_internal fileStream, CancellationToken cancellationToken)\r\n at Azure.AI.FormRecognizer.FormRecognizerClient.StartRecognizeCustomFormsFromUri(String modelId, Uri formFileUri, RecognizeOptions recognizeOptions, CancellationToken cancellationToken)\r\n at FormV2Console.Program.<RecognizeCustomFormsFromUri>d__3.MoveNext() in C:\Users\Samrat Alamgir\Desktop\Azure Congnitive\FormV2Console\FormV2Console\Program.cs:line 36" | string

To Reproduce Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)

  1. Recognize custom forms from a URI by follow https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/formrecognizer/Azure.AI.FormRecognizer/samples/Sample3_RecognizeCustomForms.md
  2. Use trained modelId and a valid SAS Uri

Environment:

  • Azure.AI.FormRecognizer 1.0.0-preview.1
  • .Net Core 3.1
  • Visual Studio 16.4.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
kinelskicommented, Apr 29, 2020

@SamratAlamgir Thanks once again for your feedback and for finding what’s triggering the problem. I can confirm I’m able to reproduce it and it’s in fact a bug.

I have labeled it as a bug and added it to one of our milestones. I’ll post an update here and let you know once it’s fixed.

1reaction
SamratAlamgircommented, Jun 1, 2020

You are welcome and thanks for letting me know about the update.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Form Recognizer Error - Microsoft Q&A
Hi, I am trying to create custom model on form recognizer and getting errors on all the links i have for the analyzer....
Read more >
StartRecognizeCustomFormsFro...
StartRecognizeCustomFormsFromUri returns "Parameter 'Source' is not a valid Uri." for file URI.
Read more >
The remote server returned an error 403 Forbidden SAS URI ...
The remote server returned an error 403 Forbidden SAS URI Azure Blob Storage Azure Data Factory | ADF Tutorial 2022, in this video...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found