It's not clear how each type of output binding should be used or what kinds of object should be used with each.
Ideally we would have an example for at least the most common kinds of output binding.
This is especially important since the output binding API has changed from the v1 to the v2 PowerShell functions worker.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Some examples of output bindings in the v1 PowerShell worker:
@rjmholt Thank you for your feedback! We will review and update as appropriate.
Looping in @darrenjrobinson
@TylerLeonhardt / @ggailey777 Any plans to add more samples for other supported bindings ?
@rjmholt I have assigned the issue to the content author to evaluate and update as appropriate.
We are currently stuck attempting to use Azure Functions v2 PowerShell Core to update a row in Azure Table Service using the Table Service Output Binding.
Can we please have an example of Updating a Row, Deleting a Row etc.
working on the Table Storage output binding, it's hard to understand how Azure storage is able to consume the request, if we are to update existing entities and not just inserting them. Any info available out there for the Pwsh func V2 folks?
Example error on runtime:
_
Executed 'Functions.Get-Metrics' (Failed, Id=c4653806-a343-4b11-b1fb-bce9014f3bc0)
[14/05/2019 5:32:40 AM] System.Private.CoreLib: Exception while executing function: Functions.Get-Metrics. Microsoft.Azure.WebJobs.Host: Error while handling parameter _binder after function returned:. Microsoft.Azure.WebJobs.Extensions.Storage: The specified entity already exists.
RequestId:cf5b541e-a002-002f-7b16-0a6532000000
Time:2019-05-14T05:32:40.2417140Z (HTTP status code 409: EntityAlreadyExists. The specified entity already exists.
RequestId:cf5b541e-a002-002f-7b16-0a6532000000
Time:2019-05-14T05:32:40.2417140Z). Microsoft.WindowsAzure.Storage: The specified entity already exists.
RequestId:cf5b541e-a002-002f-7b16-0a6532000000
Time:2019-05-14T05:32:40.2417140Z.
_
Sorry for the inconvenience. As you know, PowerShell support for Azure Functions is just now in preview, and the docs are not fully caught up.
@eamonoreilly do we have somewhere we can point customers for this information until we have PowerShell examples added to the Functions binding reference articles?
You would need to use the Table Storage module (AzTable) https://docs.microsoft.com/en-us/azure/storage/tables/table-storage-how-to-use-powershell#managing-table-entities to update existing entities. Bindings do not currently support it https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table#output
Thanks,
Eamon
Additional notes about the input/output binding formatting should be added, as this is not immediately obvious/intuitive.
For instance, if the input binding provides a JSON string, it gets converted to a hashtable, so when you set your param() binding to the object, expect it to be a hashtable and not a json.
Similarly, you can generally submit a hashtable representation of a JSON to an output binding and it will get auto-converted to JSON for you.
Example:
@{test=1} is equivalent to
{
"test": 1
}
@craigshoemaker, let's track this along with the PowerShell bindings samples work.