Firebase 的云函数-帐单帐户未配置

我刚刚为 Firebase 实现了新的云函数,但是日志中有一些东西让我感到困扰:

帐单帐户未配置。无法访问外部网络 配置计费帐户以删除这些 限制

实际上,我设法从外部网络访问该功能,所以我想知道,我真的必须提供我的帐单帐户吗?消防站的文件里没有这方面的内容。

我正在使用 Spark 订阅计划的个人测试目的,我不想添加帐单信息,如果我还不打算支付任何东西。

68101 次浏览

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.


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.

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.

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.

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.

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

Doug stevenson's answers helped me best:

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

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.

[...]

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

If you navigate to 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.

enter image description here

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.

1.Depreciate the Node Version set node version 8

   "engines": {
"node": "8"
},

2.Then deploy firebase by following command as You guys Know

> firebase deploy
Then you'll get this type of https://i.stack.imgur.com/4hWQZ.png output in your terminal if you noticed above image marked with red line this is your firebase project hosted region. if you too also get same result everything is done we are in final step

manually we have to hit our project endpoint

 https://yourregion-firebaseprojectname.cloudfunctions.net/yourfunctionname
(exported function name)
 

In my case https://us-central1-socialape-d5dab.cloudfunctions.net/helloWorld

or follow this steps

1.Depreciate node version to 8
2. firebase deploy
3. you'll get deploy complete message above that message you'll see
functions[helloWorld(us-central)]:Succesful update operation .
4. this us-central  is your project hosted region
prefix to this [helloWorld   is your function name  get this information from uour output terminal.
5.  After  that https://yourregion-firebaseprojectname.cloudfunctions.net/yourfunctionname
(exported function name)       which is  helloWorld