node.js Cloud Functions for Firebase - 未配置结算帐号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42784135/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 18:05:03  来源:igfitidea点击:

Cloud Functions for Firebase - Billing account not configured

node.jsfirebasegoogle-cloud-functions

提问by Hristo Stoyanov

I just implemented the new Cloud Functions for Firebase, but there something in the log that bothers me:

我刚刚为 Firebase 实现了新的 Cloud Functions,但日志中有一些让我烦恼的东西:

Billing account not configured. External network is not accessible and quotas are severily limited. Configure billing account to remove these restrictions

未配置结算帐号。无法访问外部网络,并且配额受到严格限制。配置结算帐号以移除这些限制

I actually managed to access the function from the external network, so I'm wondering do I really have to give my billing account? There's nothing about this in the firebase documentation.

我实际上设法从外部网络访问了该功能,所以我想知道我真的必须提供我的帐单帐户吗?firebase 文档中没有任何关于此的内容。

I'm using the Spark subscription plan for personal test purposes and I don't want to add billing info if I'm not going to pay for anything yet.

我将 Spark 订阅计划用于个人测试目的,如果我不打算支付任何费用,我不想添加帐单信息。

回答by Ian Barber



The "Billing account not configured" warning message is automatically logged by Google Cloud Functions when no billing account is configured. It doesn't mean that your code isn't working, but it merely there as a reminder just in case you have a problem.

未配置结算帐号时,Google Cloud Functions 会自动记录“未配置结算帐号”警告消息。这并不意味着您的代码不起作用,而只是作为提醒,以防万一您遇到问题。



The restriction is about outbound access - e.g. can your Function request resources from the general internet. Its absolutely fine to use a function to respond to a webhook, or to access Google-internal services such a the Realtime Database.

限制是关于出站访问 - 例如,您的功能可以从通用互联网请求资源。使用函数来响应 webhook 或访问 Google 内部服务(例如实时数据库)绝对没问题。

If you wanted to call a third party web service (for example) you'd need to enable billing.

如果您想调用第三方网络服务(例如),您需要启用计费。

For the other quotas, take a look at: https://firebase.google.com/pricing/- as you can see there are limits to the number of invocations (125,000 at time of writing) and CPU and memory (40k cpu-seconds and 40k GB-seconds) in the free tier.

对于其他配额,请查看:https: //firebase.google.com/pricing/- 如您所见,调用次数(撰写本文时为 125,000)以及 CPU 和内存(40k cpu-秒和 40k GB 秒)在免费层。

回答by bernatfortet

Doug stevenson's answershelped me best:

道格史蒂文森的回答对我帮助最大:

TL;DR:It's a warning message. if you are not doing outbound calls, you are fine

TL;DR:这是一条警告信息。如果你不打外线电话,你没问题

That warning message appears for all functions when executing on the Spark plan. It's just a warning - you can ignore it if you're doing doing any outbound networking in your own own.

We're looking into getting that message changed or removed so that it's less confusing.

[...]

在 Spark 计划上执行时,所有函数都会出现该警告消息。这只是一个警告 - 如果您正在自己进行任何出站网络,则可以忽略它。

我们正在考虑更改或删除该消息,以减少混淆。

[...]

回答by Satta Ravi

The first invocation happens but gets marked when it is in spark plan and gets invoked from an external network ( look at logs )

第一次调用发生但在火花计划中被标记并从外部网络调用(查看日志)

At the time of this writing, Plan called BLAZE (Pay as you go) allows networking ( external access ) and has a perpetual free tier.

在撰写本文时,名为 BLAZE(即用即付)的计划允许联网(外部访问)并具有永久免费层。

The first 2,000,000 invocations, 400,000 GB-sec, 200,000 CPU-sec, and 5GB of Internet egress traffic is provided for free each month. You are only charged on usage past this free allotment.

每月免费提供前 2,000,000 次调用、400,000 GB 秒、200,000 CPU 秒和 5GB 互联网出口流量。您只需为超过此免费配额的使用量付费。

More on cloud function pricing https://cloud.google.com/functions/pricing

有关云功能定价的更多信息https://cloud.google.com/functions/pricing

回答by Samer s Salib

Make sure that your project is linked to a billing account.

确保您的项目与结算帐号相关联。

If you navigate to https://console.cloud.google.com/billing

如果您导航到https://console.cloud.google.com/billing

You should be able to find your Firebase project listed there. If not, then you will need to go to the list of projects, and from your projects menu, select billing then link a billing account to it.

您应该能够在那里找到您的 Firebase 项目。如果没有,那么您需要转到项目列表,然后从您的项目菜单中选择计费,然后将计费帐户链接到它。

enter image description here

在此处输入图片说明

回答by Vamshidhar Reddy

Yes you need to upgrade to blaze plan from your existing free plan which is spark. You wont be charged until you exceed the spark plan benefits.

是的,您需要从现有的免费计划(即 spark)升级到 blaze 计划。除非您超过 Spark 计划的福利,否则不会向您收费。