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

Improve error when input binding is missing

Open kwill-MSFT opened this issue 4 years ago • 0 comments

If you have the default input binding for an Activity Function:

{
  "bindings": [
    {
      "name": "name",
      "type": "activityTrigger",
      "direction": "in"
    }
  ]
}

But the run.ps1 is expecting an input parameter of a different name (ie. $InputObject): param($triggerMetadata, $InputObject)

Then a generic error is thrown when running the project in the local emulator:

[2021-06-28T14:36:50.295Z] Worker process started and initialized.
[2021-06-28T14:36:50.540Z] Worker failed to function id 8c711fde-95cf-4e73-b84a-4f39cb814df5.
[2021-06-28T14:36:50.542Z] Result: Failure
Exception: No parameter defined in the script or function for the input binding 'name'.
[2021-06-28T14:36:50.543Z] No input binding defined for the parameter 'InputObject' that is declared in the script or function.
[2021-06-28T14:36:50.544Z] 
Stack:    at Microsoft.Azure.Functions.PowerShellWorker.AzFunctionInfo..ctor(RpcFunctionMetadata metadata) in /home/vsts/work/1/s/src/FunctionInfo.cs:line 131
[2021-06-28T14:36:50.546Z]    at Microsoft.Azure.Functions.PowerShellWorker.FunctionLoader.LoadFunction(FunctionLoadRequest request) in /home/vsts/work/1/s/src/FunctionLoader.cs:line 52
[2021-06-28T14:36:50.547Z]    at Microsoft.Azure.Functions.PowerShellWorker.RequestProcessor.ProcessFunctionLoadRequest(StreamingMessage request) in /home/vsts/work/1/s/src/RequestProcessor.cs:line 222.
[2021-06-28T14:37:13.193Z] Host lock lease acquired by instance ID '0000000000000000000000004BCB02C4'.

Expected: The error message should indicate the name of the function that failed to load. "function id 8c711fde-95cf-4e73-b84a-4f39cb814df5" as seen in the error message is not meaningful to me.

kwill-MSFT avatar Jun 28 '21 14:06 kwill-MSFT