How do I create both V1 and V2 version of Azure Function Apps using VSCode on Windows - visual-studio-code

I have both .net core 2.0 and .net 4.7.2 installed.
I have installed Azure Function Apps Extension in VScode and a have verified that azure-functions-core-tools v2 is also installed.
I am able to create and debug V2 Function Apps using .netcore with no problems.
My question is how do I also install the tooling for V1 Function Apps side by side using VSCode and be able to debug as well?
thanks

Is this what you want?
1, Delete the global azure-functions-core-tools version.
Go to the cmd, use the command below:
npm uninstall -g azure-functions-core-tools
2, Then go to the VS Code, create a empty folder.
Press F1, click , then click the language.
Now you can see multiple version of function that you can choose:
Click what you want.
3, Create a folder named node_modules under your function app folder.
4, Click F1 to open the cmd terminal.
If you choose v2 just now, please use this command:
npm install azure-functions-core-tools#2
Now, It has been create successfully.
5, How to run test your azure function:
Use this command on local:
node_modules\.bin\func host start
How to create function v1 is similar.

Related

Integrated powershell core not working in vscode terminal

In vscode extension marketplace , I am getting the option of powershell preview version and not the stable version. Is there any other alternate to solve this issue?
In VS Code:
Open Extensions
Select PowerShell extension
Click the Manage cog-wheel (bottom-right corner)
Click Install Another Version... from the menu
Choose a version you feel comfortable with.
Note: I highly recommend running VS Code elevated (run as Administrator) to ensure installation of new extensions run smoothly.
Hope this helps.

Complete Rust plugin install for VS Code via command line

I'd like for my students to program Rust from within VS Code under Windows 10. I hope to provide the IT department with a set of scriptable commands to set this up on each machine.
I have installed Rustup. I also execute the following to install the "Rust (rls)" plugin:
code --install-extension rust-lang.rust
When I then open VS Code, I receive a popup message at the bottom right:
RLS not installed. Install?
If I select "Yes" everything goes well. What I would prefer, is for this step to have been completed earlier via the command line (as above with --install-extension). Is this possible? Am I missing another extension? Can this be installed via the command line?
RLS is not a VSCode extension. You can install it via rustup (I'd say before installing VSCode extension): rustup component add rls rust-analysis rust-src
More on RLS here

Launch .NET Core project in VS Code using dotnet run

We have a .net core 2.0 project that we've been using in Visual Studio. I want to switch to using VS Code. I updated the launchsettings.json to include a Project launch profile (instead of IIS) and made the necessary changes to be able to use the dotnet cli to run it.
However, when I try to launch it in VS Code I don't see where the dotnet run is being used because I want to use that command to run the project since we need to pass a configuration to that command in order for it to work. The command line looks like this:
dotnet run -c Dev --launch-profile Project
I don't know how to set up vs code to launch using the above command.

How to install grafana-cli and grafana plugin

I'm trying to install Simple JSON plugin which needs grafana-cli.
But my Terminal says command not found. Can someone please help how to install grafana-cli and grafana plugin
OS - Mac, grafana v3.0
Old question but for me I found it using
ps -ef | grep grafana
To find the location of grafana (which was /usr/sbin/grafana) and grafana-cli was there too. That dir is only in the path for the root user so switching to root (sudo su) solved the issue also.
for S.O windows, you need add manually the path of grafana-cli.exe to environment variables.
follow this steps.
open control panel.
select the option "system".
select option "advanced features"
select environment variables,
on variables of user select the row "path", select the button edit
add your path of grafana-cli.exe.
save changes.
open a new cmd terminal.
write grafana-cli and console return view of help of grafana cli commands
you can find grafana-cli on c:/programfiles/grafanalasbs/grafana/bin
grafane-cli is not present in 2.6.0 package. So i suppose you should build grafana from scratch or get an older version.

Run C# Console Application on Visual Studio Code Editor on Windows

Is there any way to create (from scratch) and run simple C# Console app in VSCode editor. ?
Can you please provide step-by-step instruction how I can do that?
What kind of files I must to include (except HelloWolrd.cs obviously)?
What kind of commands I must to execute?
Navigate to the folder you want to create the console app in. In VSCode, use Ctrl+` to open the terminal window or go to View and select Integrated Terminal. Now type the following below:
dotnet new console
dotnet restore
dotnet run
The best way at this present time to create a console application is to create a DNX style Console Application.
I would advise that you download and install the generator-aspnet Yeoman generator and use that to generate a DNX Console application. Once you've got generator-aspnet installed, in your terminal/console app type yo aspnet and select Console Application.
Here's a thorough guide to creating a DNX Console application which will work with VS Code: http://docs.asp.net/en/latest/dnx/console.html
I was trying to get a 'hello world' set up using visual studio code and c# on mac/osx.
the way I did it was as follows:
Install VS Code and the C# extension
Here (https://www.microsoft.com/net/core#macos) are instructions for installing dotnet core using brew:
Install OpenSSL
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
Install dotnet core pkg: https://go.microsoft.com/fwlink/?LinkID=827526
Create a folder somewhere and in that folder run dotnet new
Go into VS code and open the folder to get the project loaded
Open the terminal in that folder and run dotnet run
To create run as a task
CMD+shift+P then type task
select the Task: Configure Task Runner option
in the tasks.json file after the build task, add the following:
{
"taskName":"run",
"args": [
"${workspaceRoot}/project.json"
]
}