Hello,
I have deployed a Powershell Azure Function running Powershell Core 7.0.
I integrate the function with a Storage Queue.
My message queue is a String:
"WebTemplate": "STS#0",{
"SiteTitle": "TestCreation1",
"SiteURL": "TestCreation1",
"SiteLanguage": 1033
}
When adding the message in the queue, the function triggers it but I have an error in the function logs.
My function code ( run.ps - The write host are just for troubleshooting):
using namespace System.Net
# Input bindings are passed in via param block.
param($QueueItem, $TriggerMetadata)
# Write out the queue message and insertion time to the information logs.
Write-Host "PowerShell queue trigger function processed work item **: $QueueItem"
Write-Host "Queue item insertion time: $($TriggerMetadata.InsertionTime)"
Write-Host "requestBody Get-Content $QueueItem -Raw | ConvertFrom-Json"
$requestBody = Get-Content $QueueItem -Raw | ConvertFrom-Json
$WebTemplate = $requestBody.WebTemplate
Write-Host "WebTemplate: $WebTemplate"
$SiteTitle = $requestBody.SiteTitle
Write-Host "SiteTitle: $SiteTitle"
$SiteURL = $requestBody.SiteURL
Write-Host "SiteURL: $SiteURL"
$SiteLanguage = $requestBody.SiteLanguage
Write-Host "SiteLanguage: $SiteLanguage"
$SiteDescription = "Site with PowerShell"
Write-Host "SiteDescription: $SiteDescription"
Write-Output "PowerShell script processed queue message '$requestBody'"
My issue:
During the execution of
$requestBody = Get-Content $QueueItem -Raw | ConvertFrom-Json
I have an error saying the the System.Collections.Hastable does not exist.
ERROR: Cannot find path 'C:\home\site\wwwroot\System.Collections.Hashtable' because it does not exist.
Anyone, any ideas from what it can come from?
Thanks in advance