Azure function return 500 internal server error when using CosmosDB as the input binding

Edward An 0 Reputation points
2024-10-14T08:14:12.5566667+00:00

I am following this exercise for every step and I am getting 500 errors in the response.

The request hasn't even reached the code.

Function.json

{
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get",
        "post"
      ]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    },
    {
      "name": "inputDocument",
      "direction": "in",
      "type": "cosmosDB",
      "partitionKey": "/id",
      "methods": [],
      "databaseName": "edward",
      "collectionName": "Bookmarks",
      "connectionStringSetting": "wetwertwret_DOCUMENTDB",
      "id": "id"
    }
  ]
}

codeUser's image

This question is related to the following Learning Module

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
1,715 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AmaranS 6,845 Reputation points Microsoft Vendor
    2024-10-14T10:56:40.07+00:00

    Hi Edward An,

    It seems like the error consistently occurs in your HttpStart function due to an undefined extraInputs property. To troubleshoot:

    1. Review the index.js file of HttpStart for extraInputs references.
    2. Verify correct function parameters passed to getClient.
    3. Check the durable functions library docs for usage changes.
    4. Ensure function bindings handle extraInputs properly.
    5. Add logging to track variable values.
    6. Investigate recent code changes.
    7. Monitor Azure Function logs for additional clues.

    This approach should help pinpoint and resolve the issue. Let me know if you need further assistance!
    If you need more help, feel free to share additional details or code snippets, and I'll do my best to assist you further. I hope the information we provided was helpful to you! If it was, please consider accepting the answer by clicking the Accept Answer/Upvote button. Your feedback is valuable and can assist others with similar questions. Thank you for contributing to improving Microsoft Q&A!

    Thank you.

    1 person found this answer helpful.

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.