Output binding to table storage with fsharp
See original GitHub issueI’m new to Azure Functions.
Any idea on how I can bind out to a Azure Storage Table with F#? I’m attempting to use ICollector (taken from C# example which works fine) but unfortunately it is not being recognised which I thought it would be as documented here - https://azure.microsoft.com/en-us/documentation/articles/functions-reference-csharp/. (Yes, I see that this is ref to C#)
Code:
open System
open System.IO
type Job = {
PartitionKey :string;
RowKey: string;
Name :string
}
let inputPath = Environment.GetEnvironmentVariable("input")
let input = File.ReadAllText(inputPath)
let message = sprintf "F# script processed queue message '%s'" input
System.Console.Out.WriteLine(message)
let b = [{PartitionKey = "Key"; RowKey = Guid.NewGuid().ToString(); Name=input}]
let outputTable = new ICollector<Job>()
outputTable.Add(b)
With wanting to keep with F# as much as I possibly can with Azure Functions, if F# is yet to be fully supported, would you recommend a strategy of using C# for bindings and using F# for helper / supporting methods? Plus, are there any gotcha’s I need to know about?
Warmest regards,
Garrard.
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Get started with Azure Table Storage using F# ...
This tutorial shows how to write F# code to do some common tasks using Azure Table Storage or the Azure Cosmos DB Table...
Read more >Azure Tables output bindings for Azure Functions
Use an Azure Tables output binding to write entities to a table in Azure Cosmos DB for Table or Azure Table Storage.
Read more >Azure Tables with F# | Compositional IT
storageAcc is creating the necessary storage account and container "blogtablestoragedemo" with a table called "employees". deployment is ...
Read more >Using FSharp with Table Storage and Azure Functions
A quick look at how to use the FSharp.Azure.Storage package in Azure Functions.
Read more >functions-bindings-storage-table-output.md
This output binding only supports creating new entities in a table. If you need to update an existing entity from your function code,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mathewc, I finally got there!
Works as expected.
Thanks for all your help today. Very much appreciated.
Warmest regards,
Garrard.
Awesome 😃 I don’t think you need the
#if !COMPILED
block though - that’s just for our local project.