[BUG] Getting error for FormRecognizerClient StartRecognizeCustomFormsFromUri for Azure SAS Uri
See original GitHub issueDescribe 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)
- 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
- 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:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
@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.You are welcome and thanks for letting me know about the update.