Azure / Azure/azure-functions-powershell-worker

Activity functions throw an ArgumentNullException when they don't return a value

Open
#1,099 0 comments 0 reactions 0 assignees View on GitHub
P2
Dominant language
C#
Stars
215
Forks
61
Avg merge
21h 4m
Merged PRs (30d)
6

Description

**Summary**: Not returning a value in an activity function throws an `ArgumentNullException` saying `Value cannot be null. (Parameter: input)`. Durable Functions docs state that activity functions can optionally return a value (https://learn.microsoft.com/en-us/azure/azure-functions/durable/quickstart-powershell-vscode#create-your-functions).

**Repro**:

This code throws the exception

```
param($name)

Write-Host "Hello $name!"
```

This code works as expected

```
param($name)

"Hello $name!"
```

**Workaround**:
Return a non-null value from the activity function.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the PowerShell worker's activity-function invocation and result handling, reproducing the difference between the Write-Host example and the string-returning example. Trace how a no-value result reaches the exception and check the existing activity-function tests, if present. Done means an activity function that returns no value completes without the ArgumentNullException while value-returning functions still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.