|
| 1 | +# How to add Environment variables to VS Code |
| 2 | + |
| 3 | +## Table of Contents |
| 4 | +- [Overview of Environment Variables in VS Code](#overview-of-environment-variables-in-vs-code) |
| 5 | +- [User Level Environment Variables](#user-level) |
| 6 | +- [Environment Level Environment Variables](#environment-level) |
| 7 | +- [Project Level Environment Variables](#project-level) |
| 8 | +- [Creating Environment Variables](#creating-variables) |
| 9 | +- [Deleting Environment Variables](#deleting-variables) |
| 10 | + |
| 11 | +## Overview of Environment Variables in VS Code |
| 12 | + |
| 13 | +Datacoves injects several[ environment variables](/reference/vscode/datacoves-env-vars.md) on your behalf. However, you may need to add additional variables to run scripts, test code etc. This doc will walk you through adding your own environment variables at the user, environment and project level. These variables are only available in your VS Code, not Airflow. For Airflow we recommend you use Airflow Variables or [Datacoves Secrets](/reference/admin-menu/secrets.md) |
| 14 | + |
| 15 | +## User Level |
| 16 | + |
| 17 | +Environment variables set at the user level will only be available to the workspace environment of the individual who created them. |
| 18 | + |
| 19 | +### Step 1: Navigate to your user settings in the top right-hand corner |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | +### Step 2: Navigate to `VS Code Environment Variables` |
| 24 | +### Step 3: Select `Add` |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +## Environment Level |
| 30 | + |
| 31 | +>[!NOTE] You must have admin permissions to add variables across the project or user environments. |
| 32 | +
|
| 33 | +Environment level variables will be available to everyone with access to the environment ie) The Development Environment. |
| 34 | + |
| 35 | +### Step 1: Navigate to the environment menu |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +### Step 2: Navigate to `VS Code Environment Variables` |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +### Step 3: Select `Add` |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +## Project Level |
| 48 | + |
| 49 | +Project level variables will be available across all environments in a project. |
| 50 | + |
| 51 | +### Step 1: Navigate to the project menu |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +### Step 2: Navigate to `VS Code Environment Variables` |
| 56 | + |
| 57 | + |
| 58 | + |
| 59 | +### Step 3: Select `Add` |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +## Creating variables |
| 64 | + |
| 65 | +Creating variables is simple. Add the key following the correct format and add the desired value. |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +## Deleting variables |
| 70 | + |
| 71 | +Deleting variables is also simple. Simply navigate to the Project or Environment settings. |
| 72 | + |
| 73 | +### Step 1: Toggle the delete option or the red trashcan |
| 74 | + |
| 75 | +### Step 2: Save Changes |
| 76 | + |
| 77 | +If you do not save changes, the variable will not be deleted. |
| 78 | + |
| 79 | + |
| 80 | + |
0 commit comments