Hello! I am facing an exception: "Failed to create "C:\local\Temp\tmpEXO..psm1' with allocation size X because the disk was full" with my Azure Function running powershell on consumption plan. I understand that with this plan you only get 0.5GB of temp storage, but my powershell script only connects to Exchange Online and does the cleanup afterwards, so I shouldn't have the exception after couple of requests being sent (it seems temp storage limit is hit after about 20 subsequent HTTP requests in a row):
using namespace System.Net
param($Request, $TriggerMetadata)
Connect-ExchangeOnline -ManagedIdentity -Organization ORGANIZATION.onmicrosoft.com
Disconnect-ExchangeOnline -Confirm:$false
# Associate values to output bindings by calling 'Push-OutputBinding'.
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
StatusCode = [HttpStatusCode]::OK
Headers = @{
"Content-type" = "application/json"
}
})
Is there a way to erase the temp folder content after every HTTP invocation of this function?