0
votes

I am learning Azure Function Apps, and I have a function with the input binding for a Azure Storage Queue. The function below is the default template code that is provided for powershell in the portal

param([string] $QueueItem, $TriggerMetadata)

# Write out the queue message and insertion time to the information log.
Write-Host "PowerShell queue trigger function processed work item: $QueueItem"
Write-Host "Queue item insertion time: $($TriggerMetadata.InsertionTime)"

The first Write-Host in this function prints

INFORMATION: PowerShell queue trigger function processed work item: System.Collections.Hashtable

How can I print the exact queue item that has caused this function to run? I have tried a few things none of them seem to work.

1
Any update on this issue?George Chen

1 Answers

0
votes

I can reproduce this issue, I suppose you don't check your queue after you send the message, if you check the azure queue you will find the message content is System.Collections.Hashtable, that's what you get this message. So actually the $QueueItem is not a Hashtable object it's just a string.

enter image description here

Suppose azure queue doesn't support hashtable, so maybe you could change your message type to solve this problem or you could serialize your data then send it to azure queue.