Mohamed Borhene Hamedi
Mohamed Borhene Hamedi

Reputation: 139

Firebase how to deploy cloud functions for free

i follwed some tutorials to deploy firebase cloud functions step by step and i did not found any of this tutorial spoke about paying or something like this even the official firebase documentation but when i run firebase deploy this command i get this error

 firebase deploy 

=== Deploying to 'wissal-4736a'...

i  deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint

> functions@ lint C:\Users\HP\Desktop\aaaa\functions
> eslint .

+  functions: Finished running predeploy script.
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/wissal-4736a/usage/details

For additional information about this requirement, see Firebase FAQs:

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

so should i upgrade my account to a apayed account or i made some errors or ther is a solution to get a free account because i'm a student i need some helps and thank you

Upvotes: 0

Views: 1819

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 600036

As the error message says, deploying Cloud Functions to your Firebase project requires that the project is on the pay-as-you-go plan. This doesn't necessarily mean you have to pay for it though, as the plan comes with a free tier. From the Firebase pricing page:

On the Blaze plan, Cloud Functions provides a perpetual free tier. The first 2,000,000 invocations, 400,000 GB-sec, 200,000 CPU-sec, and 5 GB of Internet egress traffic is provided for free each month. You are only charged on usage past this free allotment.

An alternative is to switch to using the Node.js 8 runtime, which doesn't yet require the account to be on a billing plan.

For more on this and how billing around Cloud Functions works in Firebase, see the FAQs on Cloud Functions runtime support and Cloud Functions pricing.

Upvotes: 3

Related Questions