Azure / Azure/azure-functions-powershell-worker
Pushing output to AppendBlob
- Dominant language
- C#
- Stars
- 215
- Forks
- 61
- Avg merge
- 21h 4m
- Merged PRs (30d)
- 6
Description
I'm trying to push data to an append blob, but keep getting the same error: _"Cannot bind to page or append blobs using 'out string', 'TextWriter', or writable 'Stream' parameters."_
My understanding is that this has been implemented in Azure WebJobs SDK ([#865](https://github.com/Azure/azure-webjobs-sdk/pull/865), [#859](https://github.com/Azure/azure-webjobs-sdk/issues/859)); that the SDK locates and correctly identifies the blob type as "AppendBlob"; and that the error is thrown from [WriteBlobArgumentBinding.cs](https://github.com/Azure/azure-webjobs-sdk/blob/3f4ec78be9f43bb041937425ced00b341883aa42/src/Microsoft.Azure.WebJobs.Extensions.Storage/Blobs/Bindings/WriteBlobArgumentBinding.cs). The error message seems to be specific to C# bindings.
What I can't figure out is what type is expected here in Powershell - neither a `string `or `byte[]` seems to work? Is this even supported in the Powershell worker?
---
To reproduce:
(1) create an empty append blob, e.g. `az storage blob upload <...> --type append`
(2) function.json:
```
{
"bindings": [
{
"name": "workItem",
"type": "queueTrigger",
"direction": "in",
"queueName": "append-to-blob",
"connection": "MY_STORAGE"
},
{
"name": "receipt",
"type": "blob",
"direction": "out",
"path": "folder/myblob.dat",
"connection": "MY_STORAGE"
}
]
}
```
(3) Run.ps1:
```
param([string] $workItem, $TriggerMetadata)
Write-Host "PowerShell queue trigger function processed work item: $workItem"
Push-OutputBinding -Name 'receipt' -Value $workItem
```
(4) Log stream output:
```
[Information] Executing 'Functions.AppendToBlob' (Reason='New queue message detected on 'append-to-blob'.', Id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)
[Information] INFORMATION: PowerShell queue trigger function processed work item: Hello, World!
[Error] Executed 'Functions.AppendToBlob' (Failed, Id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, Duration=62ms)Cannot bind to page or append blobs using 'out string', 'TextWriter', or writable 'Stream' parameters.
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.