Is Cloud Functions in Firebase Free or Not (Cloud Functions deployment requires the pay-as-you-go (Blaze) billing plan)
Asked Answered
E

10

80

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??

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
Eurhythmic answered 9/7, 2020 at 21:33 Comment(0)
M
50

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:

Why will I need a billing account to use the Node.js 10 runtime 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. These architecture updates will apply for functions deployed to the Node.js 10 runtime. Usage of these services will be billed in addition to existing pricing.

In the new architecture, Cloud Build supports the deployment of functions. 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. You'll be billed for each container required to deploy a 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.

To understand more about how your bill might change, please review the following

If you want to target node 8, that might still work. 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.

Cloud Functions still has a monthly free allowance that's documented in the pricing page. 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.

Mendoza answered 9/7, 2020 at 21:38 Comment(11)
Thank you a lot I will using node 8 to testing and after everything is oky I make upgrade node to 10Eurhythmic
Does this mean the days of 'totally free server-side code execution' are over? They need a billing account to execute code at the server side?Eure
@JoyGeorgeKunjikkuru There is a free montly allowance for Cloud Functions. You won't be billed for that allowance. You only pay for overage. The credit card is required in case you do go over.Mendoza
So there is literally no way to specify that our website should just go down instead of spending over-charge. If our websites suffer a DDOS attack we're fully responsible for paying. Doesn't make sense for small-time developersDiathermic
@Diathermic You should contact Firebase support directly with your questions about billing. support.google.com/firebase/contact/supportMendoza
Thanks @DougStevenson for your response. I got the idea but as @ pete mention, it is for my own usage and doesn't want to pay or get into calls with FB after DDoS. I moved to Heroku who still provides free tier without CC.Eure
notice you can limit the usage cloud.google.com/docs/quota#capping_usageSpringer
When switching to blaze, I would suggest to enable a budget notification. That can be configured in Google Cloud Console.Faithfaithful
@DougStevenson Credit card is must? can I use debit card, I am a beginner.Froissart
@Springer sadly you can't set limits for Firestore reads/writes etc. Support for that was dropped in end of 2019. One can only create budgets where you get a 'warning' if you are about to exceed your planned limit. But a real limit can't be set, which is very disappointing. => firebase.google.com/docs/firestore/quotasAntidisestablishmentarianism
firebase.google.com/docs/functions/… node 8 is no longer an option for new function. "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; if you have deployed functions to the Node.js 8 runtime, we recommend that you upgrade to the Node.js 14 runtime."Springer
F
22

Currently, the firebase is using node version 10 for cloud functions which requires you to pay (pay as you go).

You can change the node from 10 to 8 (to use for free of cost) in functions/package.json

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

However, this will be soon deprecated. This is what the firebase website says:

Node.js 8 has been deprecated. Starting Feb 15, 2021, we'll no longer support new deploys or updates of Node.js 8 functions. Starting Mar 15, 2021, we'll no longer support executions of existing Node.js 8 functions.

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.

Fossa answered 28/8, 2020 at 1:21 Comment(1)
It has been disabled, Now firebase only allow to deploy using 10+ versionForestall
C
7

Just to clear confusion here

Firebase seems to close the cloud functions for spark plan. So, I thought what if firebase is planning to take away the free plan features one by one.

Here is the answer from their FAQ page.

Does this change to Cloud Functions mean the Firebase free plan (Spark) is going away?

No. This change will not affect the other Firebase products. The Spark plan is going to be unavailable for Cloud Functions after March 15, 2021.

Canning answered 22/11, 2020 at 16:32 Comment(1)
I have deployed functions in June 2021 and have free Spark plan, now I can't deploy: Your project superapp must be on the Blaze (pay-as-you-go) plan to complete this command. Required API cloudbuild.googleapis.com can't be enabled until the upgrade is completeGurgle
B
4

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.

Bethea answered 4/7, 2021 at 9:14 Comment(0)
M
2

Cloud Functions are only available on the Blaze plan which means you'll need to enter a credit card.

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.

If you want to experiment with Cloud Functions for free, you should use the local Firebase Emulator Suite to develop.

Masterful answered 6/10, 2022 at 0:16 Comment(0)
S
1

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

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; if you have deployed functions to the Node.js 8 runtime, we recommend that you upgrade to the Node.js 14 runtime.

And therefore it is no longer an option

Springer answered 17/6, 2021 at 8:56 Comment(2)
I have deployed functions in June 2021 and have free Spark plan, now I can't deploy: Your project superapp must be on the Blaze (pay-as-you-go) plan to complete this command. Required API cloudbuild.googleapis.com can't be enabled until the upgrade is completeGurgle
So, you agree? @GurgleSpringer
R
1

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!

Roaster answered 9/9, 2022 at 17:23 Comment(0)
K
0

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. 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

Kaiserslautern answered 28/4, 2021 at 23:17 Comment(0)
E
0

use something like

firebase deploy --only "hosting,firestore,database,storage"

Be sure , "functions" is not in the list after --only

Excommunication answered 24/6, 2023 at 21:6 Comment(0)
N
0

I've just had this issue resolved. you have a .firebase directory, in that there is a functions dir. Delete it. This was the problem. At least for me.

Novick answered 21/9, 2023 at 20:37 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.