I'm working on creating a Proof-Of-Concept Azure Function using C# script. that needs to talk to an Azure Storage Table.
I followed the instructions at Azure Table storage input bindings for Azure Functions and I get an error saying "Can't bind Table to type 'Microsoft.WindowsAzure.Storage.Table.CloudTable".
In my research I've found that the example in the document is out of date anyways and that I should be using a different set of namespaces. Yet I cannot find examples, documentation, or even blog posts talking about how to consume the correct namespaces. In fact, everything I've found online just says that my code should "just work".
Here's the code that currently won't even compile:
#r "Newtonsoft.Json"
#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Table;
using System.Net;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Primitives;
using Newtonsoft.Json;
public static async Task<IActionResult> Run(HttpRequest req, ILogger log, CloudTable releasebranchtable)
{
log.LogInformation("C# HTTP trigger function processed a request.");
string name = req.Query["name"];
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
dynamic data = JsonConvert.DeserializeObject(requestBody);
name = name ?? data?.name;
string responseMessage = string.IsNullOrEmpty(name)
? "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response."
: $"Hello, {name}. This HTTP triggered function executed successfully.";
return new OkObjectResult(responseMessage);
}
Here's my csproj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.0.1" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="5.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="host.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="local.settings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
</None>
<None Update="HttpTrigger2/run.csx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="HttpTrigger2/function.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Here's the bindings (though generated by Azure I think):
{
"name": "releasebranchtable",
"tableName": "MyTable",
"connection": "AzureWebJobsStorage",
"direction": "in",
"type": "table"
}
Do updated docs or complete examples even exist? I feel like I've searched everywhere and have come up empty.

