Unclear how to implement custom bindings in Visual Studio via function.json
I am authoring an Azure Function project in Visual Studio 2017 with multiple functions. I would like to leverage binding in order to delete records from Azure Table Storage. As stated in this article, since update/delete is not yet supported in entity bindings, the recommended approach is to create a custom binding and map it to a CloudTable instance. However, since the function.json is generated at build time, it is unclear to me where to author these custom bindings in Visual Studio.
Any help would be greatly appreciated.
Understandable - something I hear frequently so need to figure out how to make more clear in docs. With C# the function.json is automatically generated, but all features are usable via Attributes in C#. So to create a CloudTable binding in your code would look something like:
[FunctionName("Function1")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)]HttpRequestMessage req,
[Table("myTable")] CloudTable outputTable,
TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
outputTable.ExecuteAsync(...);
.....
}
Thanks @jeffhollan, sometimes it's hard to see the forest with these stupid trees in the way.
You and me both. Happy to help 😃