94

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

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.

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.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Hristo Stoyanov
  • 1,960
  • 1
  • 12
  • 24

7 Answers7

90

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.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Ian Barber
  • 19,765
  • 3
  • 58
  • 58
  • Thanks for the answer , what about the 'limited quotas' ? – Hristo Stoyanov Mar 14 '17 at 13:51
  • What about sending an email in response of a change on the database? Do you enable the billing for that? Using gmail services for example. – Roberto Mar 20 '17 at 12:24
  • Gmail would be google API so should be OK, something like sendgrid you'd need billing for. – Ian Barber Mar 23 '17 at 19:16
  • @IanBarber It means activate the Blaze / Flame plans? Does the Blaze plan charges only after the Free limits are used? – SidFerreira Apr 19 '17 at 23:42
  • Blaze plan only. Switching to that will immediately bill for realtime database and hosting - if you were within free limits but switch to the blaze plan, you will be charged for that usage (which can come as a surprise!) – Ian Barber May 12 '17 at 01:13
  • So I can't send emails from a domain I own's mail server until I configure the Blaze / Flame plane? – Clay Banks Aug 04 '17 at 21:43
  • That's correct - any outbound calls require a paid plan. – Ian Barber Aug 04 '17 at 23:03
  • How to call Youtube API in Firebase functions @IanBarber – Anirudha Gupta Apr 03 '18 at 14:56
  • I know this answer is from a while ago, but can a function make a GET request to another endpoint in your own application without needing billing? That is, can an `onCall()` function make a GET Request to an `onRequest()` function to download a file with `res.download()` from Express? Thank You. –  Jan 21 '19 at 22:02
  • 2
    Does everyone get this? If I am getting this log do I have to add billing info? –  May 23 '19 at 23:45
  • Yes i was getting this error of Billing. Now i purchase the Blaze plan and error gone . We will have to purchase Balze plan to sort out this issue. – Anand_5050 Aug 30 '19 at 06:05
  • Is this still current? If you use functions to manage firestore or auth requests, then you dont need a payment plan? Or is this answer dated now that cloud functions are unavailable (altogether, both in internal within firebase and external calls)? – Mel Jul 06 '21 at 22:51
39

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.

[...]

Community
  • 1
  • 1
bernatfortet
  • 2,084
  • 4
  • 22
  • 28
  • 7
    That error message confused me too! I vote for changing the message to be more clear. – Thomas David Kehoe Jan 23 '18 at 17:38
  • You can filter out that message in the console by clicking the dropdown "All log levels" and choosing "Info". All your logs and errors will still show, but the nag message will go away. – Jack Steam Jun 07 '19 at 21:47
9

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

Samer
  • 3,848
  • 4
  • 25
  • 24
7

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

Satta Ravi
  • 81
  • 5
2

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
0

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

use the cloud console to enable your cloud function api first instead of trying to activate it by firebase