The first thing to keep in mind is that messages in the Event Hub are stored as JSON and (more importantly) when an Azure Function reads from a Event Hub it automatically converts the JSON to PowerShell native constructs. That is to say if I have an array of JSON objects, these are converted to an array of Hash Tables. Setting up PowerShell Runbook Select the newly created Automation account. Select Runbooks. Click on Create a runbook. Give a Name of your choice and make sure to select Runbook type as PowerShell Select the newly created Runbook and it will open a new window. Click on Edit. Paste the below PS script in the Editor pane.