Azure / Azure/azure-functions-core-tools

System.Private.CoreLib: Result: Failure Value cannot be null. (Parameter 'value')

Open
#2,044 6 comments 1 reaction 0 assignees View on GitHub
investigate
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

`System.Private.CoreLib: Result: Failure
Exception: Value cannot be null. (Parameter 'value')`

above error is thrown in local-dev runtime environment when calling the HttpTrigger with POST and JSON-format payload on a PowerShell AzFunctionApp-v3
NB: error is thrown before any code is executed
for validation i left in my run.ps1 just the following lines (commenting all the rest) and error was still thrown:
```
using namespace System.Net
param($Request, $TriggerMetadata)
```

azure-functions-core-tools installation:
`npm i -g azure-functions-core-tools@3 --unsafe-perm true`
which translated to version `3.0.2534`

**fix = downgrade to 3.0.2245:**
`npm i -g azure-functions-core-tools@3.0.2245 --unsafe-perm true`

### configuration files + other environment tools & versions

function.json
```
{
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "Request",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "Response"
}
]
}

```

.vscode/settings.json
```
{
"azureFunctions.deploySubpath": ".",
"azureFunctions.projectLanguage": "PowerShell",
"azureFunctions.projectRuntime": "~3",
"azureFunctions.showExplorer": true,
"azureFunctions.stopFuncTaskPostDebug": false,
"azureFunctions.validateFuncCoreTools": true,
"debug.internalConsoleOptions": "openOnSessionStart",
"debug.allowBreakpointsEverywhere": true,
"debug.extensionHost.useV3": true,
"powershell.powerShellDefaultVersion": "~7",
"terminal.integrated.shell.windows": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
}
```

host.json
```
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
},
"managedDependency": {
"enabled": true
},
"extensions": {
"http": {
"routePrefix": ""
}
}
}
```

VSCode 1.46.0
MS PowerShell VSCode Extension v2020.6.0
`=====> PowerShell Integrated Console v2020.6.0 <=====`

```
PSVersion 7.0.2
PSEdition Core
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure in a PowerShell HTTP-trigger project with Azure Functions Core Tools 3.0.2534, using the supplied function.json, host.json, and minimal run.ps1. Compare the behavior with version 3.0.2245, then trace the local invocation path to identify the regression. Done means the POST request runs without the null-value failure, or the affected version and workaround are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, node.js, powershell
Domain
cli, developer-experience
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.