Install the Cloud Code for VS Code extension

Stay organized with collections Save and categorize content based on your preferences.

The Cloud Code for VS Code extension adds support for Google Cloud development to VS Code.

Before you begin

Before you install Cloud Code, confirm that the following tools are installed and set up on your system:

  1. Install and set up Visual Studio Code on your machine.
  2. Install and configure language support.

    The Cloud Code extension works best with the following languages:

  3. Install Git. Git is required for copying samples to your machine.

  4. Install the Docker client and add it to the PATH environment variable:

    • If you're building exclusively using Cloud Build or Jib, you can skip installing Docker.
    • If you're using Windows Home, for steps to set up your Docker client, see Docker Desktop for Windows Home guide.
    • If you're using WSL but can't install Docker for Desktop, use minikube instead for local development with Cloud Code.
  5. If you're using Google Cloud, create a Google Cloud project and then enable billing.

    Projects allow you to collect the related resources for a single application in one place, manage APIs, enable Google Cloud services, add and remove collaborators, and manage permissions for Google Cloud resources.

Install Cloud Code

  1. Install the extension from the Visual Studio Code Marketplace.

    Alternatively, open the Extensions view in VS Code by clicking Extension icon Extensions or pressing Ctrl/Cmd+Shift+X, search for the Cloud Code extension, and then click Install.

  2. If prompted, restart VS Code.

    After the extension has successfully installed, the Cloud Code icons are added to the left side activity bar and ready for use. You can further configure your Cloud Code installation by specifying your preferences using the top-level application taskbar: Code > Preferences > Settings > Extensions > Cloud Code.

Custom versions of dependencies

By default, Cloud Code has Auto dependencies turned on and installs some command-line dependencies for you automatically. If you turn off auto dependencies, you can use custom versions of the dependencies but you must install the dependencies yourself for Cloud Code to work.

To use custom versions of Cloud Code dependencies:

  1. Click Manage > Settings and then set Auto Dependencies (cloudcode.autoDependencies) to off.
  2. Install the following dependencies on your PATH:

Optional: Verify Cloud Code vsix using VsixSignTool

To verify the Cloud Code vsix with the VsixSignTool, perform the following steps:

  1. Ensure you're using the following:

    • Nuget package manager
    • Windows OS
    • A production release of Cloud Code
  2. Install the Microsoft VsixSignTool and take note of the installation path.

  3. Open VS Code and navigate to Extensions icon in VSC Extensions > Cloud Code.

  4. In the Details tab, under Extension Resources, click Marketplace.

  5. On the Marketplace page in your browser, under Resources, click Download Extension to download the packaged version of Cloud Code. This downloads the packaged version of Cloud Code, which has a .vsix file extension, to your default download directory.

  6. If you'd prefer to verify a different version than the latest, click the Version History tab and select a different version to download.

  7. When the download is complete, open a terminal window and run the following:

  8. Confirm that the output matches the following:

    VsixSignTool Success: Package PATH_TO_DOWNLOADED_VSIX is valid.

Authentication with Google Cloud

To help with application development with Google Cloud APIs, when you log in to the gcloud CLI, your Application Default Credentials are updated.

Log in to Google Cloud

If you aren't logged in to Google Cloud, follow these steps to log in:

  1. In the status bar, next to Cloud Code, click Connect to Google Cloud.
  2. Follow the prompts to log in using your web browser.

Log out of Google Cloud

  1. Click Cloud Code icon Cloud Code and then expand Help and Feedback.
  2. Click Sign Out of Google Cloud and when prompted, select Sign-out.
  3. Alternatively, you can log out using the Command Palette. Press Ctrl/Cmd+Shift+P or click View > Command Palette, and then click Sign out of all accounts in Google Cloud SDK.

Change the active Google Cloud project

  1. In the VS Code status bar, next to the current project name, click Switch Project Switch Project.
  2. Select a project or enter keywords in the search bar to filter projects.

What's next

Get Support

To send feedback, report issues on GitHub, or ask a question on Stack Overflow.