1

I am facing one issue with Azure function. When I run a function it throws me with the below error

Java HTTP trigger processed a request. Function "GetPoolFunction" (ID: cb5d4ff4-f6c4-4986-96ba-8590e59b7423) invoked by Java Worker Executed 'Functions.GetPoolFunction' (Succeeded, Id=5cda0f15-36e4-4f1d-9d4e-3e4a9fb296f3) An unhandled host error has occurred. Microsoft.AspNetCore.Server.Kestrel.Core: An item with the same key has already been added.

Please help if any one has gone throw this issue.

Thanks and Regards, Balki

Llazar
  • 3,167
  • 3
  • 17
  • 24
Balki
  • 41
  • 2
  • Seems not an Azure function specific problem, check [this thread](https://stackoverflow.com/questions/5648060/an-item-with-the-same-key-has-already-been-added), if it doesn't help, you could provide your code snippet. – Jerry Liu Nov 20 '18 at 01:58
  • Hi Jerry, Thanks but this does solve my problem. I am writing the function app in javaBelow is the snippet of the code – Balki Nov 20 '18 at 10:58
  • Hi Jerry, I am writing the code in java for the function app @FunctionName("GetPoolFunction") public HttpResponseMessage run(@HttpTrigger(name = "reqpoolsfunction", methods = { HttpMethod.GET }, authLevel = AuthorizationLevel.ANONYMOUS,webHookType=WebHookType.NONE,route="v1/getpool") HttpRequestMessage> request, final ExecutionContext context) So when this code was compiled with the help of maven it generate the function.json file – Balki Nov 20 '18 at 11:03
  • { "scriptFile" : "..\\premiumandpenaltyfunction-1.0-SNAPSHOT.jar", "entryPoint" : "net.scorpiogroup.pool.pnp.functions.getpoolfunction.GetPoolFunction.run", "bindings" : [ { "type" : "httpTrigger", "name" : "reqpoolsfunction", "direction" : "in", "route" : "v1/getpool", "authLevel" : "anonymous", "methods" : [ "GET" ] }, { "type" : "http", "name" : "$return", "direction" : "out" } ] } – Balki Nov 20 '18 at 11:03
  • So in my application I have three functions and evity the out direction name is same that what i guess its happening wrong I change the out parameter by no luck. – Balki Nov 20 '18 at 11:04
  • You code seems outdated as `webHookType` has been abandoned in new function jave worker. Could you try to work with latest [cli](https://github.com/Azure/azure-functions-core-tools#installing), create new function app and put your code there? If it doesn't work, could you put three function method signatures(like the one above) in your question? – Jerry Liu Nov 21 '18 at 10:22
  • Thanks Jerry I am able to solve the issue by clearing the cahe using command. nuget.exe local --clear and after this command the code works and also done a dotnet restore to restore the extensions. – Balki Nov 23 '18 at 09:48

0 Answers0