azure-functions-powershell-worker icon indicating copy to clipboard operation
azure-functions-powershell-worker copied to clipboard

Invoke-ActivityFunction: Why is the `Input` attribute required?

Open AdamCoulterOz opened this issue 5 years ago • 3 comments

While running a PowerShell durable function, I've stumbled across an exception I'm confused about:

Invoke-ActivityFunction -FunctionName 'FireTheCigarettes'

# Exception:
# Type: System.ArgumentNullException
# Message: Value cannot be null. (Parameter 'input')

I've realised that the Input parameter is set as [ValidateNotNull], but my activity function FireTheCigarettes doesn't require any input. Im wondering why the attribute is required, and doesn't have a sensible default?

https://github.com/Azure/azure-functions-powershell-worker/blob/622867482d16441ce342e5e90f8e7aeb050b5d20/src/Durable/InvokeActivityFunctionCommand.cs#L13-L30

AdamCoulterOz avatar Nov 08 '20 23:11 AdamCoulterOz

I'm an idiot, please ignore me. This error was being thrown on the way back up because I wasn't returning anything from the action function. Although the error message wasn't very intuitive.

AdamCoulterOz avatar Nov 09 '20 00:11 AdamCoulterOz

You're not an idiot. I wasted 8+h until I found this here...

jethrovaneetvelde avatar Jul 07 '22 09:07 jethrovaneetvelde

This is something we should address. I'm going to re-open this issue for tracking. I'll look to make a sensible default. Apologies for the confusion in the API.

davidmrdavid avatar Jul 11 '22 20:07 davidmrdavid