The Google Cloud Data Agent Kit extension for Visual Studio Code lets you work with your Google Cloud data resources in your preferred IDE.
Before you begin
Before you install the Data Agent Kit extension for VS Code, do the following.
Install VS Code and Python
On your local machine, install Visual Studio Code and Python.
- Install and set up Visual Studio Code. If you have already installed it, update it to the latest version.
- Install Python.
Set up Google Cloud
- If you don't already have one, create a Google Cloud project.
- Enable billing.
Install the gcloud CLI
You must install and sign in to the Google Cloud CLI. The extension uses credentials from both the gcloud CLI and application default credentials (ADC).
- Open the terminal on your local machine or in VS Code.
- If you haven't previously installed the gcloud CLI, follow the steps on Install the gcloud CLI to download and install the gcloud CLI.
In the terminal, run
gcloud initto initialize the gcloud CLI:gcloud initRun the following command and follow the prompts to authenticate and set up application default credentials:
gcloud auth login && gcloud auth application-default loginUpdate the gcloud CLI to the latest version:
gcloud components update
Required roles
To get the permissions that you need to use the Data Agent Kit extension for VS Code, ask your administrator to grant you the following Identity and Access Management (IAM) roles on the project. For more information, see Review required roles.
Depending on your use case, you might need additional roles, but these roles let you install and set up the extension. The complete list is available in the IDE extension settings.
- BigQuery Data Viewer (
roles/bigquery.dataViewer) - BigQuery Job User (
roles/bigquery.jobUser) - BigQuery Metadata Viewer (
roles/bigquery.metadataViewer) - BigQuery Read Session User (
roles/bigquery.readSessionUser) - Dataproc Editor (
roles/dataproc.editor)
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
The predefined roles contain the permissions required to use the extension. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
- bigquery.config.get
- bigquery.datasets.get
- bigquery.datasets.getIamPolicy
- bigquery.jobs.create
- bigquery.readsessions.create
- bigquery.readsessions.getData
- bigquery.readsessions.update
- bigquery.tables.createSnapshot
- bigquery.tables.export
- bigquery.tables.get
- bigquery.tables.getIamPolicy
- bigquery.tables.list
- bigquery.tables.replicateData
- dataform.locations.get
- dataform.locations.list
- dataform.repositories.create
- dataform.repositories.list
- dataplex.projects.search
- dataproc.clusters.use
- dataproc.operations.get
- dataproc.sessions.create
- dataproc.sessions.delete
- dataproc.sessions.get
- dataproc.sessions.list
- dataproc.sessions.terminate
- dataproc.sessionTemplates.create
- dataproc.sessionTemplates.delete
- dataproc.sessionTemplates.get
- dataproc.sessionTemplates.list
- dataproc.sessionTemplates.update
- resourcemanager.projects.get
Install the extension
- In VS Code, click Extensions or press
Ctrl/Cmd+Shift+X. - Search for
Google Cloud Data Agent Kit. - Click Install.
- If prompted, restart VS Code. After the extension has installed successfully, the Google Cloud Data Agent Kit icon is added to the activity bar.
Sign in to Google Cloud Data Agent Kit
Next, you must authenticate to Google Cloud Data Agent Kit using the same account you used to sign in to the gcloud CLI.
If the sign-in dialog doesn't open automatically, look for a Google Cloud Data Agent Kit sign-in link in the status bar near the bottom of the IDE window, and click it.
Alternatively, you can press
Ctrl/Cmd+Shift+Pto open the command palette, search for and select Google Cloud Data Agent Kit: Sign in.Follow the prompts and complete signing in.
A web page confirming that authentication is complete is displayed.
Close the page and return to the IDE.
Enable APIs
After you sign in to your Google Account, you need to enable the APIs in your Google Cloud project for all services that you use for your data science or data engineering workflows.
To see the list of APIs and see the ones that are already enabled, do the following:
- In the activity bar, click the Google Cloud Data Agent Kit icon.
- Expand Settings, and then click Settings.
- Select Common.
- Click Required APIs.
APIs to enable
- AlloyDB API
- BigLake API
- BigQuery API
- Cloud Composer API
- Cloud Dataplex API
- Cloud Resource Manager API
- Cloud Spanner API
- Cloud SQL
- Cloud SQL Admin API
- Cloud Storage API
- Dataproc API
- Dataproc Release Manager API
- Vertex AI API
Troubleshoot
If you run into issues, try signing out of Google Cloud Data Agent Kit and the gcloud CLI and then signing in again. To find additional methods for diagnosing and resolving installation errors, see Troubleshoot the Data Agent Kit extension for VS Code.