Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your credentials.
This variable applies only to your current shell session, so if you open
a new session, set the variable again.
Example: Linux or macOS
exportGOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"
Replace KEY_PATH with the path of the JSON file that contains your credentials.
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-08。"],[[["You can configure Application Default Credentials (ADC) in a local development environment using either user credentials or service account credentials."],["To use user credentials, initialize the Google Cloud CLI with `gcloud init` and create local authentication credentials with `gcloud auth application-default login`, unless using Cloud Shell."],["Service account impersonation can be used to create a local ADC file, but it requires the Service Account Token Creator role and is only supported in specific languages like C#, Go, Java, Node.js, and Python."],["Service account keys are an alternative to user accounts or service account impersonation, but they pose security risks and require setting the `GOOGLE_APPLICATION_CREDENTIALS` environment variable."],["When you set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable, it is checked first by ADC, and then other locations only if necessary."]]],[]]