Azure Function Table Storage output binding using an identity-based connection

Viewed 161

I'm trying to configure an Azure Table Storage output binding for an Azure Function (in JavaScript) using an identity-based connection instead of a connection string. I believe I've setup the Function as per the docs but I'm getting this error:

System.Private.CoreLib: Exception while executing function: Functions.AzureTvDataFetcher. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string 'AzureWebJobsAzuretvTableStorageConnection' does not exist. Make sure that it is a defined App Setting.

The error mentions that it should be a defined app setting, which it is. This is my local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "",
    "FUNCTIONS_WORKER_RUNTIME": "node",
    "AzuretvTableStorageConnection__tableServiceUri": "https://<account-name>.table.core.windows.net"
  }
}

And these are the triggers/bindings defined in function.json:

{
  "bindings": [
    {
      "authLevel": "function",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [
        "get"
      ]
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    },
    {
      "type": "table",
      "tableName": "azuretv",
      "name": "azuretvTableBinding",
      "direction": "out",
      "connection": "AzuretvTableStorageConnection"
    }
  ]
}

The docs mention that it requires the extension bundle version 2.x, which is installed, see my host.json:

"extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
},

So I'm not sure what I'm doing wrong. If I use a connection string instead it works fine. I've also deployed the Function app, created a managed identity for it and assigned the Storage Table Data Contributor role to the storage account but I still get the same error. Any ideas?

0 Answers
Related