简体   繁体   English

Is Cloud Functions in Firebase Free or Not(Cloud Functions部署需要按需付费(Blaze)计费方案)

[英]Is Cloud Functions in Firebase Free or Not (Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan)

When i make my first deploy function I can't deploying Because I have Error Asks me to make Upgrade to my account to Blaze I need to Know Can i deploy Function when i use free account??当我第一次部署时 function 我无法部署,因为我有错误要求我将我的帐户升级到 Blaze 我需要知道 我可以在使用免费帐户时部署 Function 吗?

Output: Output:

i  deploying functions
i  functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i  functions: ensuring required API cloudbuild.googleapis.com is enabled...
!  functions: missing required API cloudbuild.googleapis.com. Enabling now...
+  functions: required API cloudfunctions.googleapis.com is enabled

Error: Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan. To upgrade your project, visit the following URL:

https://console.firebase.google.com/project/institute-for-admin/usage/details

For additional information about this requirement, see Firebase FAQs:

https://firebase.google.com/support/faq#functions-runtime

As the message says, you can't deploy functions on the Spark free tier, if you target nodejs 10. Read the link to the FAQ :如消息所述,如果您以 nodejs 10 为目标,则无法在 Spark 免费层上部署功能。阅读常见问题解答的链接

Why will I need a billing account to use the Node.js 10 runtime for Cloud Functions for Firebase?为什么我需要一个计费帐户才能使用 Node.js 10 运行时 for Cloud Functions for Firebase?

Because of updates to its underlying architecture planned for August 17, 2020, Cloud Functions for Firebase will rely on some additional paid Google services: Cloud Build , Container Registry , and Cloud Storage .由于计划于 2020 年 8 月 17 日更新其底层架构,Firebase 的 Cloud Functions 将依赖一些额外的 Google 付费服务: Cloud BuildContainer RegistryCloud Storage These architecture updates will apply for functions deployed to the Node.js 10 runtime.这些架构更新将适用于部署到 Node.js 10 运行时的功能。 Usage of these services will be billed in addition to existing pricing.除了现有定价之外,还将对这些服务的使用收费。

In the new architecture, Cloud Build supports the deployment of functions.在新架构中,Cloud Build 支持功能的部署。 You'll be billed only for the computing time required to build a function's runtime container.您只需为构建函数的运行时容器所需的计算时间付费。

Cloud Storage, interoperating with Google Container Registry , will provide storage space for the containers in which functions run. Cloud Storage 与Google Container Registry互操作,将为运行函数的容器提供存储空间。 You'll be billed for each container required to deploy a function.您需要为部署 function 所需的每个容器付费。 If you're currently using Cloud Functions within free usage limits, you may notice new, small charges for each container stored— for example, 1GB of storage is billed at $0.026 per month .如果您当前在免费使用限制内使用 Cloud Functions,您可能会注意到每个存储容器的新的小额费用 - 例如,1GB 的存储按每月 0.026 美元计费

To understand more about how your bill might change, please review the following要了解有关您的帐单可能如何变化的更多信息,请查看以下内容

If you want to target node 8, that might still work.如果您想以节点 8 为目标,那可能仍然有效。 But it's been deprecated, and your functions will eventually stop working.但它已被弃用,您的函数最终将停止工作。 You would still have to migrate them to node 10 in that case, and provide a billing account.在这种情况下,您仍然需要将它们迁移到节点 10 ,并提供一个计费帐户。

Cloud Functions still has a monthly free allowance that's documented in the pricing page . Cloud Functions 仍具有定价页面中记录的每月免费配额。 But you will have to provide a credit card and be on a billing plan in order to use it.但是您必须提供信用卡并加入计费计划才能使用它。 You will be responsible for paying for any monthly overage.您将负责支付每月的超额费用。

Currently, the firebase is using node version 10 for cloud functions which requires you to pay (pay as you go).目前,firebase 使用节点版本 10 的云功能,需要您付费(即用即付)。

You can change the node from 10 to 8 (to use for free of cost) in functions/package.json您可以在functions/package.json中将节点从10更改为8(免费使用)

"engines": {
    "node": "8". // changed from 10 to 8
  },

However, this will be soon deprecated.但是,这将很快被弃用。 This is what the firebase website says:这就是 firebase 网站所说的:

Node.js 8 has been deprecated. Node.js 8 已被弃用。 Starting Feb 15, 2021, we'll no longer support new deploys or updates of Node.js 8 functions.从 2021 年 2 月 15 日开始,我们将不再支持 Node.js 8 函数的新部署或更新。 Starting Mar 15, 2021, we'll no longer support executions of existing Node.js 8 functions.从 2021 年 3 月 15 日开始,我们将不再支持执行现有的 Node.js 8 函数。

https://firebase.google.com/support/faq?authuser=0#expandable-10-label https://firebase.google.com/support/faq?authuser=0#expandable-10-label

EDIT编辑

This might be a legacy.这可能是一种遗产。 Please check the latest comments for an updated policy.请查看最新评论以获取更新的政策。

Just to clear confusion here只是为了清除这里的混乱

Firebase seems to close the cloud functions for spark plan. Firebase 似乎关闭了 Spark 计划的云功能。 So, I thought what if firebase is planning to take away the free plan features one by one.所以,我想如果 firebase 计划一个一个地取消免费计划功能怎么办。

Here is the answer from their FAQ page.这是他们的常见问题页面的答案

Does this change to Cloud Functions mean the Firebase free plan (Spark) is going away?对 Cloud Functions 的这种更改是否意味着 Firebase 免费计划 (Spark) 将消失?

No. This change will not affect the other Firebase products.不会。此更改不会影响其他 Firebase 产品。 The Spark plan is going to be unavailable for Cloud Functions after March 15, 2021. 2021 年 3 月 15 日之后,Cloud Functions 将无法使用 Spark 计划。

I don't think Cloud Function is free even if you stay within the free quota as they seem to charge for container storage which seems to automatically get created when you deploy a function.我不认为 Cloud Function 是免费的,即使您保持在免费配额内,因为它们似乎对容器存储收费,这似乎是在您部署 function 时自动创建的。

I was also facing the same issue!我也面临同样的问题! If you only concerns with learning cloud functions of firebase instead of running command firebase-deploy try firebase-serve it will serve locally firebase cloud functions on your machine and you can use it!如果您只关心学习 firebase 的云函数而不是运行命令 firebase firebase-deploy try firebase-serve它将在您的机器上本地服务 firebase 云函数并且您可以使用它!

in this time when I write these lines node.js 8 is no longer available 'The Spark plan is unavailable for Cloud Functions after March 15, 2021' so I think that we have migrate to node.js 10 and higher but with no free plan:we have to 'pay as we go' by providing our cards number series.在我写这些行时 node.js 8 不再可用 'The Spark plan is available for Cloud Functions after March 15, 2021' 所以我认为我们已经迁移到 node.js 10 及更高版本但没有免费计划:我们必须通过提供我们的卡号系列“即用即付”。 Note that this 'blazer plan' could be free if we do note exceed some limits for more details please see this Start for free, then pay as you go请注意,如果我们确实注意到超出某些限制,则此“西装外套计划”可能是免费的有关更多详细信息,请参阅此免费开始,然后按您付款 go

According to the Firebase Pricing , you need to go on the blaze plan in order to use Cloud Functions, but you still have a free quota of resources (at the time of writing this response)根据Firebase 定价,您需要 go 才能使用 Cloud Functions,但您仍然有免费的资源配额(在撰写此回复时)

As of June 8, 2020 the answer is no it is not free anymore It used to be an option to set the engine to a legacy node 8 but as firebase states截至 2020 年 6 月 8 日,答案是否定的,它不再免费它曾经是将引擎设置为旧节点 8 的选项,但正如 firebase 所述

Node.js 8 (deprecated on June 8, 2020) Deployment of functions to the Node.js 8 runtime was disabled in the Firebase CLI on December 15, 2020. Execution of already-deployed functions will stop at some point in the future; Node.js 8(弃用于2020年6月8日)将功能部署到Z3B2819DD4C24C24EDA2FAFFAF2052EEF2052EEF449551Z 8运行时间已在Z035548892FFF4ETTIME中受到了损害,即if you have deployed functions to the Node.js 8 runtime, we recommend that you upgrade to the Node.js 14 runtime.如果您已将函数部署到 Node.js 8 运行时,我们建议您升级到 Node.js 14 运行时。

And therefore it is no longer an option因此它不再是一种选择

Cloud Functions are only available on the Blaze plan which means you'll need to enter a credit card. Cloud Functions 仅适用于 Blaze 计划,这意味着您需要输入信用卡信息。

If you want to stop using Cloud Functions, remove the functions section from your firebase.json (if it exists) and also delete the functions folder that firebase init created for you.如果您想停止使用 Cloud Functions,请从firebase.json (如果存在)中删除functions section ,并删除firebase init 为您创建的functions folder

If you want to experiment with Cloud Functions for free, you should use the local Firebase Emulator Suite to develop.如果您想免费试用Cloud Functions,您应该使用本地Firebase Emulator Suite 进行开发。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM