System.Private.CoreLib: Result: Failure Value cannot be null. (Parameter 'value')
See original GitHub issueSystem.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
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Related StackOverflow Question
@carct Do you have any code in the profile.ps1 file in the root of your app? Does the issue repro if you remove or comment out all the code there?
@carct I was unable to repro this on a simple app. If possible, could you please share:
func startlog.