How to fix Exception while executing Azure function to write into Azure Table Storage

Annika Biere 0 Reputation points
2023-01-24T11:21:19.12+00:00

I'm currently trying to create a simple Function with C# writing into Azure Table Storage.

Using the learn.Microsoft-Documentation "Connect Azure Functions to Azure Storage using Visual Studio Code" I already built a Function writing in Azure Queue Storage without any problems.

But when using the Documentation "Azure Tables output bindings for Azure Functions" ([https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table-output?tabs=isolated-process%2Cstorage-extension&pivots=programming-language-csharp) I get the Error System.Private.CoreLib: Exception while executing function: Functions.TableFunction. Microsoft.Azure.WebJobs.Extensions.Tables: '' is not a valid value for a partition key or row key.

I'm using the exact isolated process code from the article except the Trigger Method, which I changed to HTTP Trigger.

User's image

Thank you for your help !

Azure Table Storage
Azure Table Storage
An Azure service that stores structured NoSQL data in the cloud.
171 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,118 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,020 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,481 Reputation points
    2023-01-25T05:40:23.3233333+00:00

    @Annika Biere

    Thanks for reaching out to Q&A forum.

    This issue could occur if the Azure function extension bundle is not added to the host.json file. Please add the appropriate version of the extension bundle.

    {
        "version": "2.0",
        "extensionBundle": {
            "id": "Microsoft.Azure.Functions.ExtensionBundle",
            "version": "[3.3.0, 4.0.0)"
        }
    }
    
    

    Reference : [https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-register#extension-bundles

    Hope this helps! Feel free to reach out to me if you have any queries or concerns.


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.