如何将Azure功能与Google Storage连接

时间:2020-08-24 05:56:30

标签: python azure azure-functions google-cloud-storage google-authentication

我尝试将我的azure函数连接到Google云端存储,但是我在身份验证方面遇到了一些问题。 我可以连接JupyterNotebook中的所有内容,但是在我的azure功能中,我无法提供凭据作为路径。在我的azure函数中,我无法提供路径,但是将凭据包含在变量中。它返回错误Exception: OSError: [Errno 63] File name too long。我认为发生错误是因为它将凭据作为路径。 我现在找不到连接到Google存储空间费用的方法。

这是我为获得客户所做的工作的超简短版本:

from google.cloud import storage

google_credentials = get_credentials()
client = storage.Client.from_service_account_json(google_credentials)

有什么建议可以在天蓝色功能中通过服务帐户连接到Google吗?

最佳:-)

1 个答案:

答案 0 :(得分:0)

最后,我看到我正在使用的代码需要一个路径作为参数。我提供了凭据。