The Google Cloud 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:
- Install and set up Visual Studio Code on your machine.
Install and configure language support.
The Cloud Code extension works best with the following languages:
Install Git. Git is required for copying samples to your machine.
Install the Docker client and add it to the
- 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.
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.
Installing Cloud Code
Install the extension from the Visual Studio Code Marketplace.
Alternatively, select the Extensions view in VS Code by clicking its square icon from the left side taskbar. Search for the Cloud Code extension and then click Install.
If you're running Cloud Code on Apple M-series silicon, you're prompted to install Rosetta 2. This allows Cloud Code to automatically install some command-line dependencies. If you prefer not to install Rosetta 2, follow the steps in Custom versions of dependencies to install the dependencies manually. For more information, see Cloud Code support for Apple M-series silicon.
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
Cloud Code can install some command-line dependencies for you automatically. If any dependencies aren't already installed, Cloud Code installs them.
To use custom versions of these dependencies, follow these steps:
- Opt out of dependency management by setting Auto Dependencies
cloudcode.auto-install) to false in Settings (accessible through the Manage menu > Settings).
Install the following dependencies on your
Authentication with Google Cloud
If you're developing with Google Cloud, Cloud Code automatically installs Cloud SDK (if not already installed) and uses your active configuration's account by default. You can log in and out of this account by using any Cloud Code view (such as the Kubernetes Explorer view ) and choosing the appropriate Cloud SDK action.
Logging in this way takes you through the Cloud SDK authentication process in your web browser. To help with application development with Google Cloud APIs, your Application Default Credentials are also updated during this process.
You can log out of the Cloud SDK using the sign out icon in any Cloud Code view, accessible when you hover over the project name. If you'd like to switch projects in Cloud Code instead, you can select the switch project icon and specify your preferred project in the same account.