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.

Call Function from Logic App Standard gives error BadRequest. Http request failed: 'An item with the same key has already been added. Key: Code'.

See original GitHub issue

Using VS Code and Azure Logic App Standard extension to build a Standard Logic App locally. Using Azure Functions Core Tools for local runtime: Core Tools Version: 3.0.3904 Commit hash: c345f7140a8f968c5dbc621f8a8374d8e3234206 (64-bit) Function Runtime Version: 3.3.1.0

Calling an Azure Function deployed in Azure from the local Logic App, I get the error below. The function is still invoked and runs OK, but the Logic App Run Instance UI reports a BadRequest on the function invoke.

image

Job warning: correlationId='8b7c9843-2534-4e87-b8f4-520665bacdf2', operationName='FlowHttpEngine.GetErrorMessageFromException', jobPartition='C3B3EB386CA441A59ECADDB92E819CE9:2D08585654968131582416188788881CU00', jobId='08585654968131582416188788881CU00', message='Http request failed with exception of type 'ArgumentException' and message exception: 'An item with the same key has already been added. Key: Code'.', exception='System.ArgumentException: An item with the same key has already been added. Key: Code
[2021-11-05T11:01:25.209Z]    at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
[2021-11-05T11:01:25.210Z]    at System.Collections.Generic.Dictionary`2.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.Add(KeyValuePair`2 keyValuePair)
[2021-11-05T11:01:25.211Z]    at Microsoft.WindowsAzure.ResourceStack.Common.Extensions.ICollectionExtensions.AddRange[T](ICollection`1 source, IEnumerable`1 values)
[2021-11-05T11:01:25.212Z]    at Microsoft.Azure.Workflows.Data.Extensions.UriExtensions.WithAdditionalQueryParameters(Uri uri, QueryStringDictionary queryParameters)
[2021-11-05T11:01:25.213Z]    at Microsoft.Azure.Workflows.Data.Extensions.HttpRequestMessageExtensions.AddQueryStringAuth(HttpRequestMessage request, HttpQueryStringAuthentication authentication, ICommonEventSource logger)
[2021-11-05T11:01:25.213Z]    at Microsoft.Azure.Workflows.Data.Extensions.HttpRequestMessageExtensions.PopulateRequestAuthentication(HttpRequestMessage request, HttpAuthentication authentication, OAuthTokenCacheProvider tokenProvider, ICommonEventSource logger)
[2021-11-05T11:01:25.214Z]    at Microsoft.Azure.Workflows.Data.Engines.FlowHttpEngine.CallHttpEndpoint(ICommonEventSource logger, FlowAuthentication flowAuthentication, HttpAuthentication httpAuthentication, Nullable`1 operationOptions, HttpRequestMessage request, LoadBalancedHttpClientConfiguration configuration, OAuthTokenCacheProvider tokenProvider, CancellationToken cancellationToken, String operationName, Boolean allowTrustedRootCertificateThumbprints)
[2021-11-05T11:01:25.215Z]    at Microsoft.Azure.Workflows.Worker.Jobs.FunctionActionJob.OnExecuteRetryableAction(FlowRunActionExecutionContext actionExecutionContext, FunctionActionInput actionInput, FlowOperationState operationState)', organizationId='', activityVector='IN.09', additionalProperties='', extensionVersion='1.0.0.0', siteName='UNDEFINED_SITE_NAME', slotName='', activityId='bffa8923-c3b7-443d-8f02-fcb09a9ffcfd'.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
anthonywhitecommented, Jan 3, 2022

Microsoft support told me this is an acknowledged bug and as fix is on the way…

0reactions
anthonywhitecommented, Jun 17, 2022

@daverobinson64 yes we were calling durable functions. Now using standard HTTP action

Read more comments on GitHub >

github_iconTop Results From Across the Web

Logic apps standard - Http request failed as there is an error
Hi, I am trying to call a Rest api from Logic Apps standard error : Http request failed as there is an error:...
Read more >
BadRequest while calling Azure function from logicapp
In your Error Image of Logic App, it shows a MS Link i.e., Azure Logic App Limits and Config. It has been written...
Read more >
How do you know what's gone wrong when your API ...
Let's step back a little. One key feature of HTTP is the use of standard response status codes, like 200 or 404. When...
Read more >
Error handling with DynamoDB - AWS Documentation
If the request is unsuccessful, DynamoDB returns an error. Each error has three components: An HTTP status code (such as 400 ).
Read more >
API reference
This is the reference documentation for the GoCardless API. ... HTTP/1.1 400 (Bad Request) Content-Type: application/json { "error": { "message": "Invalid ...
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