Ouvrez VS Code, puis dans la barre d'activité, cliquez sur Extensions.
Dans la barre de recherche, recherchez l'extension Jupyter, puis cliquez sur Install (Installer). Les fonctionnalités BigQuery de VS Code nécessitent l'extension Jupyter de Microsoft comme dépendance.
Installer l'extension Google Cloud
Ouvrez VS Code, puis dans la barre d'activité, cliquez sur Extensions.
Dans la barre de recherche, recherchez l'extension Google Cloud Code, puis cliquez sur Installer.
Si vous y êtes invité, redémarrez VS Code.
L'icône Google Cloud Code est désormais visible dans la barre d'activité.
Configurer l'extension
Ouvrez VS Code, puis cliquez sur Google Cloud Code dans la barre d'activité.
Ouvrez la section Notebooks BigQuery.
Cliquez sur Se connecter à Google Cloud. Vous êtes redirigé pour vous connecter avec vos identifiants.
Utilisez la barre des tâches de niveau supérieur de l'application pour accéder à Code > Paramètres > Paramètres > Extensions.
Recherchez Google Cloud Code, puis cliquez sur l'icône Gérer pour ouvrir le menu.
Sélectionnez Paramètres.
Pour le paramètre Cloud Code : Projet, saisissez le nom du projetGoogle Cloud que vous souhaitez utiliser pour exécuter des notebooks et afficher des ensembles de données BigQuery.
Pour le paramètre Cloud Code > Bêta : Région BigQuery, saisissez un emplacement BigQuery.
L'extension affiche les ensembles de données de cet emplacement.
Développer des notebooks BigQuery
Ouvrez VS Code, puis cliquez sur Google Cloud Code dans la barre d'activité.
Ouvrez la section Notebooks BigQuery, puis cliquez sur Notebook BigQuery. Un fichier .ipynb contenant un exemple de code est créé et ouvert dans l'éditeur.
Dans le nouveau notebook, cliquez sur Sélectionner le noyau, puis sélectionnez un noyau Python.
Les notebooks BigQuery nécessitent un noyau Python local pour l'exécution. Vous pouvez créer un environnement virtuel ou en utiliser un existant.
Si elle n'a pas encore été installée dans votre environnement virtuel, installez la bibliothèque cliente bigframes :
Ouvrez la fenêtre Terminal.
Exécutez la commande pip install bigframes.
Vous pouvez désormais écrire et exécuter du code dans votre notebook BigQuery.
Explorer et prévisualiser les ensembles de données BigQuery
Ouvrez VS Code, puis cliquez sur Google Cloud Code dans la barre d'activité.
Pour afficher les ensembles de données et les tables du projet et de la région que vous avez spécifiés, ouvrez la section Ensembles de données BigQuery. Les ensembles de données publics BigQuery sont également visibles.
Pour ouvrir un nouvel onglet dans l'éditeur, cliquez sur le nom d'un tableau. Cet onglet contient les détails, le schéma et l'aperçu de la table.
Tarifs
L'extension Visual Studio Code est gratuite, mais les servicesGoogle Cloud (BigQuery, Dataproc, Cloud Storage) que vous utilisez vous sont facturés.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThe Google Cloud extension for Visual Studio Code allows users to develop and execute BigQuery notebooks, as well as browse, inspect, and preview BigQuery datasets directly within VS Code.\u003c/p\u003e\n"],["\u003cp\u003eBefore using the extension, you must ensure Python 3.11 or later is installed, install the Google Cloud CLI, initialize the gcloud CLI, configure a default project, set up Application Default Credentials, download VS Code, and install the Jupyter extension.\u003c/p\u003e\n"],["\u003cp\u003eInstalling the Google Cloud Code extension in VS Code is necessary to access its features, including the BigQuery Notebooks and BigQuery Datasets sections.\u003c/p\u003e\n"],["\u003cp\u003eTo develop BigQuery notebooks, users must select a Python kernel, and the \u003ccode\u003ebigframes\u003c/code\u003e client library should be installed in their virtual environment.\u003c/p\u003e\n"],["\u003cp\u003eThe Visual Studio Code extension itself is free, however, usage of Google Cloud services like BigQuery will incur charges.\u003c/p\u003e\n"]]],[],null,["# Use the Google Cloud for Visual Studio Code extension\n=====================================================\n\n|\n| **Preview**\n|\n|\n| This product or feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA products and features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **Note:** To provide feedback or ask questions that are related to this Preview feature, contact [bigquery-ide-plugin@google.com](mailto:bigquery-ide-plugin@google.com).\n\nThe Google Cloud [Visual Studio Code (VS Code)](https://code.visualstudio.com/)\nextension lets you do the following in VS Code:\n\n- Develop and execute BigQuery notebooks.\n- Browse, inspect, and preview BigQuery datasets.\n\nBefore you begin\n----------------\n\n1. In your local terminal, check to make sure you have\n [Python 3.11](https://www.python.org/downloads/) or later installed on your\n system:\n\n ```bash\n python3 --version\n ```\n2. [Install the Google Cloud CLI](/sdk/docs/install).\n\n3. In your local terminal,\n [initialize the gcloud CLI](/sdk/docs/initializing):\n\n ```bash\n gcloud init\n ```\n4. Configure a default project:\n\n ```bash\n gcloud config set project PROJECT_ID\n ```\n\n Replace \u003cvar translate=\"no\"\u003e\u003ccode translate=\"no\" dir=\"ltr\"\u003ePROJECT_ID\u003c/code\u003e\u003c/var\u003e with your default project.\n5. Set up [Application Default Credentials](/bigquery/docs/authentication):\n\n ```bash\n gcloud auth application-default login\n ```\n6. [Download and install VS Code](https://code.visualstudio.com/download).\n\n7. Open VS Code, and then in the activity bar, click **Extensions**.\n\n8. Using the search bar, find the **Jupyter** extension, and then click\n **Install**. The BigQuery features in VS Code require the\n Jupyter extension by Microsoft as a dependency.\n\nInstall the Google Cloud extension\n----------------------------------\n\n1. Open VS Code, and then in the activity bar, click **Extensions**.\n2. Using the search bar, find the **Google Cloud Code** extension, and then\n click **Install**.\n\n3. If prompted, restart VS Code.\n\nThe **Google Cloud Code** icon is now visible in the activity bar.\n\nConfigure the extension\n-----------------------\n\n1. Open VS Code, and then in the activity bar, click **Google Cloud Code**.\n2. Open the **BigQuery Notebooks** section.\n3. Click **Login to Google Cloud**. You are redirected to sign in with your credentials.\n4. Use the top-level application taskbar to navigate to **Code \\\u003e Settings \\\u003e Settings \\\u003e Extensions**.\n5. Find **Google Cloud Code** , and click the **Manage** icon to open the menu.\n6. Select **Settings**.\n7. For the **Cloud Code: Project** setting, enter the name of the Google Cloud project that you want to use to execute notebooks and display BigQuery datasets.\n8. For the **Cloud Code \\\u003e Beta: BigQuery Region** setting, enter a [BigQuery location](/bigquery/docs/locations#supported_locations). The extension displays datasets from this location.\n\nDevelop BigQuery notebooks\n--------------------------\n\n1. Open VS Code, and then in the activity bar, click **Google Cloud Code**.\n2. Open the **BigQuery Notebooks** section, and click **BigQuery Notebook** . A new `.ipynb` file containing sample code is created and opened in the editor.\n3. In the new notebook, click **Select Kernel**, and select a Python kernel.\n BigQuery notebooks require a local Python kernel for\n execution. You can create a new virtual environment or use one of the\n existing ones.\n\n4. If it hasn't already been installed in your virtual environment, install the\n `bigframes` client library:\n\n 1. Open the **Terminal** window.\n 2. Run the `pip install bigframes` command.\n\nYou can now write and execute code in your BigQuery notebook.\n\nExplore and preview BigQuery datasets\n-------------------------------------\n\n1. Open VS Code, and then in the activity bar, click **Google Cloud Code**.\n2. To see datasets and tables from your specified project and region, open the **BigQuery Datasets** section. BigQuery public datasets are also visible.\n3. To open a new tab in the editor, click any table name. This tab contains the table details, schema, and preview.\n\nPricing\n-------\n\nThe Visual Studio Code extension is free, but you are charged for any\nGoogle Cloud services (BigQuery, Dataproc,\nCloud Storage) that you use.\n\nWhat's next\n-----------\n\n- Learn more about [notebooks in BigQuery](/bigquery/docs/programmatic-analysis).\n- Learn more about [BigQuery DataFrames](/bigquery/docs/bigquery-dataframes-introduction)."]]