KJ3
KJ3

Reputation: 5298

Azure Functions Fail if in Directory

I've created a very simple durable function app for testing. It has 3 files (starter, orchestrator, activity) and a .csproj, along with the normal boilerplate (host.json, etc.)

When the 4 main files are in the root, the function works great. I'm using VS Code. I simply debug and "attach to C# functions".

If I move those 4 files to their own directory and register the .csproj with the .sln file, delete the bin/obj folders in root, I get an error.

chdir(2) failed.: No such file or directory
The terminal process terminated with exit code: 1

What do I need to do to tell Functions that my functions are one directory down?

Upvotes: 0

Views: 376

Answers (1)

KJ3
KJ3

Reputation: 5298

Found the issue. VS Code gets the command it runs from .vscode/tasks.json. There's one labeled "Run Functions Host". The options.cwd is the command it ends up running. You just need to add the directory in there

  "label": "Run Functions Host",
  "identifier": "runFunctionsHost",
  "type": "shell",
  "dependsOn": "build",
  "options": {
    "cwd": "${workspaceFolder}/DIRECTORY_NAME/bin/Debug/netstandard2.0"
  },

Upvotes: 1

Related Questions