我刚刚看到我们有第二代云功能,看上去很棒:https://cloud.google.com/functions/docs/2nd-gen/overview
但是我怎样才能把我的1 2nd基因功能转换成第2代呢?我看到我可以作为第2代创建一个新功能,如下所示
const functions = require('@google-cloud/functions-framework');
functions.http('helloHttp', (req, res) => {
res.send(`Hello ${req.query.name || req.body.name || 'World'}!`);
});但是旧的功能呢?有办法吗?还是我得一个接一个地删除并重新创建它们?
发布于 2022-02-23 17:36:16
云函数Gen2只适用于产品云功能,而不是Firebase函数。
Firebase函数使用库firebase-functions,而云函数使用@google-cloud/functions-framework。
在Google控制台上,这两个函数看起来都是相同的,但是如果您试图通过云函数gen2部署云函数gen1,则会收到以下错误:
Failed to create function, function projects/[PROJECT_NUMBER]/locations/[LOCATION]/functions/[FUNCTION_NAME] already exists under 'Gen 1' environment. Please delete conflicting function first or deploy the function with a different name.
您需要从Firebase函数完全迁移到全新创建的云函数gen2。
https://stackoverflow.com/questions/71195711
复制相似问题