[Form Recognizer] The given key 'Contact' was not present in the dictionary.
See original GitHub issueWe are running live Tests against other clouds like US Gov and Azure China Cloud. The goal is to check whether new azure sdk package work with other clouds or not.
Error Description:
Task StartRecognizeCustomFormsWithLabelsCanParseMultipageForm
failed in pipeline weekly-test on UsGov
. The error message as follow:
Error Message:
System.Collections.Generic.KeyNotFoundException : The given key 'Contact' was not present in the dictionary.
Stack Trace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Azure.AI.FormRecognizer.Tests.RecognizeCustomFormsLiveTests.StartRecognizeCustomFormsWithLabelsCanParseMultipageForm(Boolean useStream) in /mnt/vss/_work/1/s/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/FormRecognizerClient/RecognizeCustomFormsLiveTests.cs:line 210
at Azure.AI.FormRecognizer.Tests.RecognizeCustomFormsLiveTests.StartRecognizeCustomFormsWithLabelsCanParseMultipageForm(Boolean useStream) in /mnt/vss/_work/1/s/sdk/formrecognizer/Azure.AI.FormRecognizer/tests/FormRecognizerClient/RecognizeCustomFormsLiveTests.cs:line 217
at NUnit.Framework.Internal.TaskAwaitAdapter.GenericAdapter`1.BlockUntilCompleted()
at NUnit.Framework.Internal.MessagePumpStrategy.NoMessagePumpStrategy.WaitForCompletion(AwaitAdapter awaiter)
at NUnit.Framework.Internal.AsyncToSyncAdapter.Await(Func`1 invoke)
at NUnit.Framework.Internal.Commands.TestMethodCommand.RunTestMethod(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.TestMethodCommand.Execute(TestExecutionContext context)
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.<>c__DisplayClass1_0.<Execute>b__0()
at NUnit.Framework.Internal.Commands.BeforeAndAfterTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
Standard Output Messages:
[09:46:35.132] Request daecd95c-2c54-4c05-aea8-7b956e98083e
method: POST
uri: ***/formrecognizer/v2.0/custom/models
headers:
Accept:application/json
x-ms-client-request-id:daecd95c-2c54-4c05-aea8-7b956e98083e
x-ms-return-client-request-id:true
User-Agent:azsdk-net-AI.FormRecognizer/3.2.0-alpha.20210727.1,(.NET Core 3.1.17; Linux 5.8.0-1039-azure #42~20.04.1-Ubuntu SMP Thu Jul 15 14:11:07 UTC 2021)
Ocp-Apim-Subscription-Key:REDACTED
Content-Type:application/json
clientAssembly: Azure.AI.FormRecognizer
Error Track:
Detail: Code Link
The exception above throws by assert code :
Assert.AreEqual("Jamie@southridgevideo.com", recognizedForm.Fields["Contact"].Value.AsString());
.
Expected Behavior
The investigate so far, in local test: recognizedForm.Fields
does not contains parameter Contact
, but contains some parameters that not exist in TestFile.InvoiceMultipage
file, it’s really strange. Environment variables I gived in local test:
- Endpoint
- ApiKey
- MultipageBlobContainerSasUrl
Am I missing something or need to set other variables?
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
@maririos - Completed the updates in container, thanks for your help 😃
This issue has been fixed, so we close this issue.