Install VS Code extensions offline: step-by-step guide

You use VS Code all the time. Great tool! And you love the extensions. But for whatever reason you don’t have access to the up-to-date extension gallery to install directly within VS Code. Maybe you work on an air-gapped network somewhere? Maybe you’re in a deep, dark basement of a defense department contractor with cigarette smoke-stained 30-year-old carpet and no windows where they don’t let you connect to the internet (I feel ya! I’ve literally been there before). Or maybe you created your own nifty extension you want to install without publishing to the marketplace.

There are a lot of reasons why you might not be able to find the extension you want within VS Code and install directly within the tool. I’ve encountered this issue in a handful of situations, I’m frustrated by this, and I’m sure you’ve been frustrated by something similar since you’re reading this. Luckily there is a solution. You can install any extension manually!

Unfortunately, Microsoft recently made this harder to do. For reasons known only to Microsoft, they quietly removed the “download vsix” option from the online marketplace.

Have no fear – a few extra steps and you’ll be back on track. Obviously, and I feel like this should go without saying but I’m gonna say it anyway, please be sure you trust anything you download and install off the internet. There, now my Legal team can leave me alone.

Getting Started

If you’re used to just using the Extension Gallery in VS Code, you might not have even been aware there’s an online marketplace where citizen developers can publish extensions, along with companies like Microsoft, SAS, etc. Depending on how you’ve installed VS Code, it may or may not be mirroring the most up to date version of the marketplace. In the following examples I’m using the SAS Viya Workbench VS Code overlay, but wherever you’re using VS Code it should look pretty much the same.

In my example, I’m going to use the Azure Storage extension to demonstrate the process This is maintained and published by Microsoft. I’m also assuming you already have VS Code installed.

On the marketplace website for the Azure storage extension, you’ll see a bunch of links on the right-hand side. Under “Resources” click on the “Repository” link, which will take you to GitHub. You don’t need to be logged into GitHub or even have an account to continue.

Now you’re in the main repository for the extension. Look on the right side to find a section labeled “Releases”. Here you have a choice – you can click on the latest or if you desire an older version for some reason, click on the + xx releases link. Probably a good idea to use the latest, but you do you.

Download and Install

Either way, you’ll see some info on what was updated/included in the release you chose. There should be something called “Assets”. If this isn’t expanded, click on it, and then click the file with the .vsix extension.

Now download the extension and copy it to wherever you’re running VS Code. You folks on an air-gapped network, I’m sorry, but yes you will have to go through whatever onerous process is required of you to move digital content onto your network. You better really want this extension!

Once in a location accessible to VS Code, open that location from VS Code. Right click on the .vsix file and select install. It’s as simple as that. Now you should have the extension installed.

Take Note!

There are a couple things to note with a manual install.

The auto-update will be turned off by default. If you do have access to the internet like I do with Workbench, you can go ahead and turn on auto-update in the settings. Now that you’re installed, it should be able to update itself. If you don’t have access to the internet from VS Code, you’ll have to always go through the manual installation process for updates.

Another thing to watch out for is which extensions the one you downloaded might also need to operate. With a manual install, with or without internet access, your extension won’t be able to automatically install the others it might want. I chose Azure Storage here for a reason. It’s actually part of an extension pack under the Azure Tools Extension.

This is an over-arching extension to help you manage all your Azure assets. It still requires you to install each piece of the bundle you might care about. So really what I did in my Workbench environment the first time I tried this was installed the Azure Tools extension thinking it would come with everything I needed. Nope! Since Workbench doesn’t know about all these Azure extensions, I still had to go find the other extensions in the bundle and install them manually so all the components of the Azure Tools extension would work properly.

Learn more

SAS® Viya® Workbench Demo: Solving Your Productivity Challenges

Install VS Code extensions offline: step-by-step guide was published on SAS Users.