Saturday, November 16, 2019

Trying Out Visual Studio Online Public Preview

During this year's Microsoft Build Conference(May 2019), Microsoft first announced Visual Studio Online. And at the Ignite 2 weeks back, the public preview of Visual Studio Online is announced.

I have been trying out Visual Studio Online since then and it really has taken my heart away.

Visual Studio Online basically provides cloud-powered development environments for any type of development. It's like you have set up a virtual machine in the cloud, except you don't need to worry about setting up the OS, installing Visual Studio Code or Visual Studio. And setting up is pretty fast, mostly within like a minute. You can connect to these remote environments through a web browser, your local VS Code or Visual Studio (as of today, Visual Studio option is still in its Private Preview).

When you connected through the browser, you basically have VS Code working inside the browser itself. And when you connected to your remote environment from either of these, you are only doing the code changes in your editor, all the heavy lifting, compiling, building, debugging, restoring, etc, is happening in your remote environment. You can even open up a terminal (through VS Code) and install whatever the tools you want to configure your remote development environment and it will be accessible throughout the lifetime of your environment.

So let’s see these in action.

You need to sign up at https://online.visualstudio.com/, then create a billing plan and then you can set up as much as environments you want.
Create a Billing Plan
You can select your remote configurations as per your needs.
Create Environment
Here a nice thing is, there is an option for you to specify a Git repo, if you specify a repo, the content will be automatically cloned when the environment is setup. Now once the environment is set up, this is what it looks like and this is inside the browser itself.
Visual Studio Online
And I just opened up a terminal inside VS Code and ran dotnet --info.
dotnet --info
It’s set up with .NET Core 2.1 on Debian Linux. I have created a Web API application (I am not writing how, as you know it's dotnet new) and let’s run it.
Connecting to the forwarded port
Running


And you can debug through the browser as well.
Debugging
Now let me connect to the environment through Visual Studio Code. You can either do by clicking on the tile in Visual Studio Online dashboard or by directly from your VS Code (You need to have the Visual Studio Online extension installed).
Open in VS Code
Connect to Environment
And here, you will be asked to select the environment. Once the environment is selected and opened, you can just continue your coding you do like your local environment. And inside, Remote Explorer, you can see your environment details.
Remote Explorer
In addition to cloud-hosted environments, Visual Studio Online supports Self-hosted mode in which you can "bring your own" self-hosted environments, registering them with VS Online. For that run the VS Online: Register Local Environment command in the command palette.
Register Location Environment
But note: as of today, registering self-hosted environments while connected to a remote development environment is not yet supported.

On a final note, to use Visual Studio Online, you will need to have an Azure subscription and you will be getting billed only for the amount you use it. Idle environments automatically get suspended after reaching the auto-suspend value (which you have set when the environment was created).

I hope this helps to start off your journey with Visual Studio Online.

Happy Coding.

Cheers,
Jaliya

No comments:

Post a Comment