Skip to content

Commit 29316f0

Browse files
authored
Merge pull request #42 from zinal/ex_service-account-credentials_up1
service-account-credentials: specify SA key file through SA_KEY_FILE env var
2 parents 0c9e662 + b946430 commit 29316f0

File tree

1 file changed

+3
-1
lines changed
  • examples/service-account-credentials

1 file changed

+3
-1
lines changed

Diff for: examples/service-account-credentials/main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ def main():
2626
# specify YDB_DATABASE environment variable.
2727
database=os.getenv("YDB_DATABASE"),
2828
# construct the service account credentials instance
29+
# service account key should be in the local file,
30+
# and SA_KEY_FILE environment variable should point to it
2931
credentials=ydb.iam.ServiceAccountCredentials.from_file(
30-
"~/.ydb/sa.json",
32+
os.getenv("SA_KEY_FILE"),
3133
),
3234
)
3335

0 commit comments

Comments
 (0)