Reputation: 1496
I am experiencing difficulty debugging an azure functions project in VS Code. I created an azure project in using func init. When i click Debug from the run menu, the project builds, but on trying to run "func host start" the following error manifests:
> Executing task: func host start <
-Command : The term '-Command' is not recognized as the name of a cmdlet, function, script file, or opera
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ -Command func host start
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (-Command:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
If i run func host start manually from powershell it works fine.
So far i have tried:
Would appreciate any assistance figuring this out.
Update, adding screenshot of error:
Upvotes: 2
Views: 9963
Reputation: 345
I tried the solution of @wilson_smyth . Instead of "command prompt", selecting "Javascript Debug Terminal" option worked for me.
Upvotes: 1
Reputation: 1496
A lot of googling found a suggestion to change the default terminal in vs code. it was set to powershell, but changing it to command prompt resolved the issue.
Setting is found in the command pallet by typing "Terminal: Select Default Profile. This brings up a list of available terminals, command prompt, gitbash, windows powershell, .net powershell.
selecting command prompt allows debugging.
thanks for the help all!
Upvotes: 5
Reputation: 1301
We need to make sure that below two are available in our VS Code:
After adding them we can execute the code normally to check if we have any errors, later set the breakpoint, and hit F5 to launch the into debug, now we need to run the function in the terminal, as in my case, I use interpreter as Python, I run it as below:
We can try this method rather running it from power shell terminal.
Now the error which you are getting is related to packages missing. Also make sure to connect to your Azure AD from PS first before executing.
Upvotes: 0