Azure / Azure/azure-functions-powershell-worker
Non-Zero Powershell Exit Statuses should count as failures
- Dominant language
- C#
- Stars
- 215
- Forks
- 61
- Avg merge
- 21h 4m
- Merged PRs (30d)
- 6
Description
### Example
When performing a queue function, I may want it to initiate a retry without throwing/logging an exception. Currently a non-zero exit status from a function will cause it to consider to be completed normally, and it will not retry the queue.
```powershell
# Input bindings are passed in via param block.
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)"
Write-Warning "Exiting with status 1, I should retry at this point but I don't!"
exit 1
```
> [3/19/2020 2:27:17 PM] System Log: { Invocation-Id: 0dcaa1fc-80bb-4c21-b36b-352d6389696c; Log-Level: Trace; Log-Message: Invoking function 'RetryTest' code 756 ms after receiving request. Invocation performance details: DependenciesAvailable: 0 ms; RunspaceAvailable: 687 ms; MetadataAndTraceContextReady: 750 ms; FunctionCodeReady: 752 ms; InputBindingValuesReady: 755 ms; InvokingFunctionCode: 755 ms; }
[3/19/2020 2:27:17 PM] INFORMATION: PowerShell queue trigger function processed work item: TestMessage
[3/19/2020 2:27:17 PM] INFORMATION: Queue item insertion time: 03/19/2020 07:27:15
[3/19/2020 2:27:17 PM] WARNING: Exiting with status 1, I should retry at this point but I don't!
[3/19/2020 2:27:17 PM] Executed 'Functions.RetryTest' (**Succeeded**, Id=0dcaa1fc-80bb-4c21-b36b-352d6389696c)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.