python - 从云源存储库部署时不会触发 Firestore 云功能

标签 python firebase google-cloud-platform google-cloud-firestore google-cloud-functions

我创建了一个谷歌云源存储库,并在 main.py (在我的根目录中)中添加了以下内容

def sample_function(event, context):
    print('inside sample_function')
    return True

我使用以下命令部署了该函数:

 $ gcloud beta functions deploy sample_function \
   --entry-point sample_function \
   --runtime python37 \
   --source https://source.developers.google.com/projects/project_id/repos/repository_id/moveable-aliases/my_branch_name \
   --region europe-west1 \
   --trigger-event providers/cloud.firestore/eventTypes/document.create \
   --timeout 60s \
   --trigger-resource projects/my_project_id/databases/default/documents/finalDb/{orgId}/tasks/{taskId}

函数已成功部署,如图:

enter image description here

但是当在指定的触发路径添加文档时,云函数不会被触发。我检查了云函数日志,日志中没有任何条目显示该函数已执行。

可能是什么问题?我在部署过程中遗漏了什么吗?

P.S 我使用内联编辑器编写了类似的函数,它们似乎工作正常

最佳答案

Python 和 gcloud 目前不支持 Firebase 特定的触发器(包括 Firestore)。

编辑

gcloud 现在支持编写和部署 Firestore triggers所有支持的语言。

关于python - 从云源存储库部署时不会触发 Firestore 云功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51664813/

相关文章:

PHP Google Api 客户端 SQL 管理员未启用身份验证 IP

laravel - 我应该在 Cloud Run 中删除 Laravel 调度吗?

python - 检查文件是否未打开或未被其他进程使用

python - 从 astropy Distance 对象访问浮点值

python - 错误导入 awswrangler : AttributeError: module 'multiprocessing' has no attribute 'connection'

node.js - 为 Android 和 iOS 启用 FCM 通知的默认声音

ios - 将电话提供商与 Firebase 中的电子邮件提供商关联起来 (Swift)

python - 无法安装安装了 64 位版本的 Anaconda 的 boost 库

firebase - 如何解决异常错误:名称为[DEFAULT]的FirebaseApp不存在?

kubernetes - 如何在 GKE 中创建具有 ReadWriteMany 访问权限的动态持久卷声明?