Result: Failure Exception: System.InvalidOperationException: Unable to load Function x. A function with the id x name already exists.

Scott Weaver 5 Reputation points
2024-01-12T18:51:56.6633333+00:00

I have an azure function on a timer trigger every two minutes. This function fetches from an API and cosmos, and writes back to cosmos.

It will run fine for about a day, and then start failing with Function with id name already exists
Usually a stop and start of the function application will fix it, but thats not a solution.

I'm not really sure what to try next. No code changes or redeploys initializing this failure, seems to happen on its own at a random time.

2024-01-12 18:26:00.004
Executing 'Functions.Scoreboards' (Reason='Timer fired at 2024-01-12T18:26:00.0039251+00:00', Id=ede20170-98f6-4818-83a5-3ba256b92dae)
Information
2024-01-12 18:26:00.006
Result: Failure Exception: System.InvalidOperationException: Unable to load Function 'Scoreboards'. A function with the id '4056152028' name already exists. at Microsoft.Azure.Functions.Worker.FunctionsApplication.LoadFunction(FunctionDefinition definition) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 62 at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269 Stack: at Microsoft.Azure.Functions.Worker.FunctionsApplication.LoadFunction(FunctionDefinition definition) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 62 at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269
Error
2024-01-12 18:26:00.007
Executed 'Functions.Scoreboards' (Failed, Id=ede20170-98f6-4818-83a5-3ba256b92dae, Duration=2ms)
Error
2024-01-12 18:26:00.007
Result: Failure Exception: System.InvalidOperationException: Unable to load Function 'Scoreboards'. A function with the id '4056152028' name already exists. at Microsoft.Azure.Functions.Worker.FunctionsApplication.LoadFunction(FunctionDefinition definition) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 62 at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269 Stack: at Microsoft.Azure.Functions.Worker.FunctionsApplication.LoadFunction(FunctionDefinition definition) in D:\a\_work\1\s\src\DotNetWorker.Core\FunctionsApplication.cs:line 62 at Microsoft.Azure.Functions.Worker.GrpcWorker.FunctionLoadRequestHandler(FunctionLoadRequest request, IFunctionsApplication application, IMethodInfoLocator methodInfoLocator) in D:\a\_work\1\s\src\DotNetWorker.Grpc\GrpcWorker.cs:line 269
Error

User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
{count} vote

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,441 Reputation points Moderator
    2024-01-17T19:49:25.84+00:00

    Scott Weaver Thanks for posting this question in Microsoft Q&A and sorry for the delay in response. Please try the workaround provided in https://github.com/Azure/azure-functions-dotnet-worker/issues/2124#issuecomment-1872128984 and see if it resolves the issue.

    I am reaching out to our product team and will update you.

    Update: Our product is actively investigating this issue and will share update in the GitHub issue. Please follow the item for the latest updates. Sorry for the inconvenience caused by this issue.

    If you have any questions that I can assist with, let me know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.