Getting started with Visual Studio Online

Abhishek Sehgal
3 min readFeb 2, 2020

--

I am very excited about new developments in Microsoft eco system and have been eager to give Visual Studio Online a try. I believe it’s a great time to be a Microsoft technologies developer probably the best time. I decided why not start from scratch and get a barebones Blazor app up and running using visual studio online.

To work in VSO you need an environment to connect to (it could be a cloud environment or self-hosted). You can checkout the pricing on Microsoft website, so a decent hosted environment (linux based, windows based in in works) would set you back 40–50 per month, which isn’t terrible but self-hosted is free and nothing beats free so that’s what I chose. Mostly because I always have a desktop running in my home anyways.

  • To start with I had to create a “plan” which I think is basically linking your visual studio online account with your “Pay-As-You-Go” (or MSDN) Azure subscription.
  • Once I have created a plan next step was to create an environment and because I chose self-hosted option I installed Visual Studio Online extension on Visual Studio Code running on my desktop.
  • Once installed I ran VS Online: Register Local Environment command and followed instructions. Which are basically giving environment a name, providing a local working folder and signing in into your Azure account.
  • After few minutes the said environment is created and started showing up on my Visual Studio Online dashboard.

Now I was able to connect to my environment from right within the browser. Another thing which wasn’t very obvious but now that I think of it makes sense is once an environment has been created and registered with VSO, I can connect to it from either browser window or from any running instance of Visual Studio Code. I was able to connect to my windows based VSO environment from Visual Studio Code running on my MacBook.

To connect to VSO environment I navigated to a newly added button on the VSCode sidebar and chose the environment I want to work in.

You can obviously toggle between local and remote environments.

At this point I am ready to get started with Blazor, the new and promising technology that I think will fundamentally change the way web apps will be written in next 5 years.

First thing I did was to run following command to get a skeleton app from CLI but I ran into an error.

dotnet new blazorserverNo templates matched the input template name: blazorserver.

It was because to create blazor server app I need to install AspNet Core 3.0 SDK which was missing from my desktop. So I had to get up, goto other room and logon to my desktop and download and install SDK. I was sure lazy people like me at Microsoft would have thought about this and there’s got to be a better way. So after some searching I found this doc which allowed me install 3.0 SDK onto VSO environment which is running on my desktop in another room (but it could’ve very well been in another country) right from within terminal window. I think it’s pretty awesome!!

Now when I ran the following command it worked.

dotnet new blazorserver

TODO: I am going to play around a little more and see if I can get blazor app running and debugging from VSO and further write my experience in this article.

--

--