microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
290 stars 131 forks source link

Can't deploy from subfolder #4063

Closed dfberry closed 3 months ago

dfberry commented 3 months ago

I have a repo with 2 functions apps, one is to use at the start of the Microsoft training module and the second is the finished training module: server-start and server-end. Both have the required files except local.settings.json is named sample.local.settings.json. So both have the required host.json for Node v4pm in their subfolders.

Codespaces dev container in edge browser functions extension: v1.14.0 "azure-functions-core-tools": "^4.0.5611",

When I try to deploy the server-end, I get the following error but the host.json is present. What else is the problem?

No azure function project root could be found. This can be caused by a missing host.json file.

Output panel shows same error: 6:46:00 PM: Error: No azure function project root could be found. This can be caused by a missing host.json file.

image

dfberry commented 3 months ago

Looks like I need to set the default azure function sub for the repo:

.vscode/settings.json

{

    "azureFunctions.postDeployTask": "npm install (functions)",
    "azureFunctions.projectLanguage": "TypeScript",
    "azureFunctions.projectRuntime": "~4",
    "debug.internalConsoleOptions": "neverOpen",
    "azureFunctions.projectLanguageModel": 4,
    "azureFunctions.preDeployTask": "npm prune (functions)",
    "azureFunctions.projectSubpath": "server-end"
}