vscode-azurefunctions: Deploying my function app via VS Code failed

Repro steps:

  1. Used CLI to init a function app
  2. Used CLI to create a function (demo Hello World app)
  3. Used CLI to run locally and validated successful execution
  4. Unable to get CLI to log in successfully so unable to publish
  5. Created function app resources in Azure Portal, along with resource group, pricing / svc plan, associated with subscription, set up region / location etc.
  6. Opened project in vs code & used Azure Functions: Create Function app in Azure and got the following error shown below.

I’m not clear what the suggestions below mean, can you help decypher what needs to happen to publish my function?

Action: azureFunctions.deploy Error type: Error Error Message: Failed to find preDeploy task “func: pack”. Modify the setting “azureFunctions.preDeployTask” or add that task to tasks.json.

Version: 0.18.1 OS: win32 Product: Visual Studio Code Product Version: 1.38.1 Language: en

Call Stack
Object.<anonymous> extension.bundle.js:361:81122
o extension.bundle.js:361:79501

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 30 (4 by maintainers)

Most upvoted comments

Next, instead of removing the preDeployTaks from setitngs.json, I am trying to add the preDeployTask from settings.json to tasks.json as the last item in the first object in the list – here’s the contents of the file now:

{ "version": "2.0.0", "tasks": [ { "type": "func", "command": "host start", "problemMatcher": "$func-watch", "isBackground": true, "dependsOn": "pipInstall", "azureFunctions.preDeployTask": "func: pack" }, { "label": "pipInstall", "type": "shell", "osx": { "command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt" }, "windows": { "command": "${config:azureFunctions.pythonVenv}\\Scripts\\python -m pip install -r requirements.txt" }, "linux": { "command": "${config:azureFunctions.pythonVenv}/bin/python -m pip install -r requirements.txt" }, "problemMatcher": [] } ] }

Then I try to deploy again…

image

But I just get back to the original error:

Failed to find preDeploy task "func: pack". Modify the setting "azureFunctions.preDeployTask" or add that task to tasks.json.

Here’s what the dialog looks like, it’s specifically a notification from the Azure Functions extension it would appear:

image