Skip to content

Commit b946430

Browse files
committed
service-account-credentials example: specify SA key file through SA_KEY_FILE env var
1 parent 0c9e662 commit b946430

File tree

1 file changed

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

1 file changed

+3
-1
lines changed

examples/service-account-credentials/main.py

Lines changed: 3 additions & 1 deletion
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)