I am trying to setup a Powershell Azure function that is triggered when a file is created in a blob storage container. The function needs to process the blob file and save it to a different blob storage container.
At the moment the function does nothing, as i am trying to deal with the problem below.
I am having trouble accessing the blob from inside the powershell function. I was able to Achieve this in c# using Attributes, but it appears that Attributes are not supported in powershell.
I tried adding an Azure Blob Storage Input under the integration tab of my function, with the path "container-name/{name}". but this just causes the error: "No value for named parameter 'name'."
How can i access a blob from a powershell function with an event grid trigger?
Thanks!
function:
param($eventGridEvent, $TriggerMetadata, $inputBlob)
$fileName = $TriggerMetadata.Name;
Write-Host "file name: $($fileName)";
Push-OutputBinding -Name outputBlob -Value $fileName
function.json
{
"bindings": [
{
"type": "eventGridTrigger",
"name": "eventGridEvent",
"direction": "in"
},
{
"name": "outputBlob",
"path": "https://storage01.blob.core.windows.net/container-name",
"connection": "Storage01ConnectionString",
"direction": "out",
"type": "blob"
},
{
"name": "inputBlob",
"path": "container-name/{name}",
"connection": "Storage01ConnectionString",
"direction": "in",
"type": "blob"
}
]
}