Is it possible to create and write to a local file in a Powershell Core Azure Function?
Here is an extract from the script I'm running (using the blob storage trigger).
param([byte[]] $dockerFile, $TriggerMetadata)
Write-Host "Processing updated DockerFile: $($TriggerMetadata.dockerFile)"
Write-Host "---------------------------------------------------------"
Write-Host "Create local Docker File using contents from blob storage"
New-Item -Name $TriggerMetadata.snapshotId -ItemType "file"
[io.file]::WriteAllBytes($TriggerMetadata.snapshotId, $dockerFile)
Get-Content $TriggerMetadata.snapshotId
Write-Host "---------------------------------------------------------"
Using New-Item
throws this ->
ERROR: Could not find file 'D:\home\site\wwwroot\<filename>'.
And Using [io.file]::WriteAllBytes throws this -> Exception calling "WriteAllBytes" with "2" argument(s): "Could not find file 'D:\home\site\wwwroot\<filename>'."
Do Azure Functions have permissions to create files locally?