通过 gcloud auth 命令在合作实验室笔记本中对 pubsub 进行身份验证
Authenticating to pubsub in a co-lab notebook via the gcloud auth command
我想使用 !gcloud auth
命令通过合作实验室笔记本对 pubsub 进行身份验证。但是,当我 运行 该命令时,我能够对云 sql 以及 gcp 存储桶进行身份验证,但是当我 运行 [=12] =]命令:
DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
我想避免将我的云凭据上传到 google 驱动器文件夹以使用 pubsub 进行身份验证,因为我希望能够在我的组织中共享此笔记本,以便其他具有正确访问权限的用户可以还 运行 直接从他们的笔记本端,无需上传他们自己的服务帐户凭据。有什么办法可以做到这一点?提前致谢。
使用:
from google.colab import auth
auth.authenticate_user()
如 this example 所示,显示 Google 云存储访问权限:
https://colab.research.google.com/notebooks/io.ipynb#scrollTo=NQX0hbfYaEKc
我想使用 !gcloud auth
命令通过合作实验室笔记本对 pubsub 进行身份验证。但是,当我 运行 该命令时,我能够对云 sql 以及 gcp 存储桶进行身份验证,但是当我 运行 [=12] =]命令:
DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application. For more information, please see https://cloud.google.com/docs/authentication/getting-started
我想避免将我的云凭据上传到 google 驱动器文件夹以使用 pubsub 进行身份验证,因为我希望能够在我的组织中共享此笔记本,以便其他具有正确访问权限的用户可以还 运行 直接从他们的笔记本端,无需上传他们自己的服务帐户凭据。有什么办法可以做到这一点?提前致谢。
使用:
from google.colab import auth
auth.authenticate_user()
如 this example 所示,显示 Google 云存储访问权限: https://colab.research.google.com/notebooks/io.ipynb#scrollTo=NQX0hbfYaEKc