Skip to content

Commit 31aa374

Browse files
authored
Revise GCP setup instructions for Python credentials
Updated instructions for setting up Application Default Credentials for Python to access GCP, removing old steps and adding new login command.
1 parent c4d9fc3 commit 31aa374

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

‎_partials/gcp_setup_mid.md‎

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,7 @@
1-
- Store the service account json file somewhere you'll remember, for example:
2-
3-
``` bash
4-
/Users/MACOS_USERNAME/code/GITHUB_NICKNAME/gcp/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json
5-
```
6-
7-
- Store the **absolute path** to the `JSON` file as an environment variable:
8-
9-
``` bash
10-
echo 'export GOOGLE_APPLICATION_CREDENTIALS=/path/to/the/SERVICE_ACCOUNT_JSON_FILE_CONTAINING_YOUR_SECRET_KEY.json' >> ~/.zshrc
11-
```
12-
13-
**Note:** every time you run this command, it will add this line to your zshrc file regardless of whether you already have it. If you made a mistake and need to fix it, preferably open the file and edit the line!
14-
15-
You can do so by running
1+
Now let's set up Application Default Credentials so your Python code can access GCP:
162

173
```bash
18-
code ~/.zshrc
4+
gcloud auth application-default login
195
```
206

21-
in the Terminal! 😄
7+
This will open a browser window. Log in with the same Google account you used to create your GCP project. Your credentials will be saved automatically.

0 commit comments

Comments
 (0)