How to setup Visual Studio Codespaces for collaborative use
Published Jun 18 2020 12:01 AM 9,612 Views
Microsoft

In an ever-changing climate, we find ourselves working remotely, many organizations were not prepared for such a change.  There has been a vast cultural shift, but also a technical shift.  IT teams are now almost entirely remote, prior to that many teams did have a remote option, but primarily worked onsite to access their IT systems. 

 

Recent customer projects I have been working on have required the developer and operations teams to innovate remotely in an effort to deploy infrastructure as code and develop their application into Azure. While working alongside these customers, I noticed they were writing all of their code in Notepad++ (I mean everything – Bash, HCL, Go, PowerShell, C#, etc.). Source code repositories are not always used, and development is done locally on each persons’ laptop. Productivity was severely limit because of this and the project itself seemed to take longer than it should.

 

In introducing VS Code, the customer team was transfixed seeing all the features that enabled us to write code collaboratively.  The plethora of extensions and the ability to use things like IntelliSense and LiveShare mase it easier for us to work together. This shift in development enabled the customer team to be productive from any location, share their sessions from their browser, and maintain data residency and compliance approval from the security and operations teams.

 

To get VS Codespaces setup it’s really quick and easy.

 

  1. Browse to https://online.visualstudio.com/login and click the ‘sign in’ button. Sign in with your login (this will be your Azure subscription login).

 

  1. Create a new Codespaces environment by selecting ‘Create new plan’.  You can create a new plan from the blue button or the selector at the top of the page. Once you create a plan, you can create one or more actual codespaces.  The plan is effectively your billing plan, where your codespace is an instance (billing is down to each codespace and its usage).

plan.png

 

  1. Select the subscription and location where you would like to run your plan from. It is suggested that you choose the region that is geographically closest to you (or where your organization is permitted to deploy its resources into).  Select ‘Advanced Options’ and give your plan a name, as well as assigning it its own resource group.

billing.JPG

  1. Once the plan is created, you can create your Codespace by selecting the blue box, ‘Create Codespace’.  Name your Codespace, you also have the option to add in the link for your Git repository here.  This is where you’ll choose your ‘Instance Type’, you will have various size and performance options, varying in OS, RAM and CPU.  Choose the performance that best suits your needs. Choose ‘Suspend Idle Codespace after..’, this will allow you to suspend an inactive session so that you are not getting billed for the Codespace being online and using compute. Once you’ve chosen your configuration, select ‘Create’

         Note: You can choose a smaller instance and scale up when you need to, saving you spend on             your Codespace

createcodespace.JPG

 

  1. Viola!  Your Codespace will initialize and will be up and running in a matter of seconds.
  2. Customize your Codespace, add in extensions, and code away!

newcodespace.JPG

 

It is really that easy and quick to get a development environment up and running! Take the time to customize the environment to suit your needs, it will make developing on a cloud-hosted environment feel much more natural.  You can bring your collection of dotfiles and synchronize your Git identity, themes and settings so that every environment you create is setup to what you like. You can also tailor Visual Studio Codespaces by bringing your own Dockerfile or images, making it a seamless and completely personal setup for the developer.  Visit here to further learn about the latest features Visual Studio Codespaces has to offer.

 

 

5 Comments
Brass Contributor

we're really in this process and need to agree on which development environment we all going to be working in. Maybe codespace gives us the ability to prepare dev env centrally. Thanks @April Edwards we will take a look at it.

Microsoft

That's great!  You can import your preferred settings into DevSpaces and takes the burden off having to lockdown the dev environments on each developers machine.

Brass Contributor

Can you explain why you would have a codespace (i.e. pay for a VM) and not just have a free repo in GitHub or Azure DevOps and work from that via VSCode?

Brass Contributor

@thommck Since we're working with BYOD usages models. Every employee is using a different dev setup. With CodeSpace we could ensure that development is done on a predefined centrally stored setup to lift the burden of incompatibilities. As well we could do this with a good set of test before commits. But as told we look into this option and figure out what's best for us.

Microsoft

@thommck  there are various reasons.  @pheeeling stated what his team uses.  We also find customers lock down their developers' machines and VSCode cannot launch properly.  Some users cannot run VS Code in a container instance due to local resources on their machines.  Most importantly, we see the consistency enabled by being able to work from anywhere to deploy your code. Some users can then work from different machines and BYOD/Security is no longer a major issue as it can be secured and contained from one environment. 

 

I have been working with quite a few customers lately that have such restrictive limits on their developers' machines, that they couldn't write their code effectively. This has been an awesome workaround, also it takes so little time to setup!

Version history
Last update:
‎Jun 15 2020 12:03 PM
Updated by: