12

I have a firebase project with multiple functions deployed. Is it possible to remove all the functions in a single go through the CLI?

I tried the command firebase functions:delete --region us-central1 and the error output was Error: Must supply at least function or group name.

As of right now, I deleted all of them specifying each of their names as such: firebase functions:delete function1 function2 ...functionN but this is very cumbersome.

The version of firebase-tools installed is v4.0.0

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
Manish Shrestha
  • 411
  • 8
  • 12

4 Answers4

9

Sign in to your Google Cloud Console at https://console.cloud.google.com, select your project, then from the list on the left pick Cloud Functions. When you get the list of functions, click the check box on the header line to select all, then the Delete button in the tool bar.

Update for comment:

I don't know what the product strategy for Firebase Console is with regard to Cloud Functions. My guess is that it is intended to provide a simplified, more convenient interface for managing Firebase related cloud functions. The Google Cloud Console provides a richer set of capabilities for managing functions and viewing logs. You could submit a feature request to Firebase to get those capabilities added to the Firebase console. Some details on the Firebase/Google Cloud relationship are provided at these links:

https://stackoverflow.com/a/42859932/4815718

https://cloud.google.com/functions/docs/concepts/functions-and-firebase

Bob Snyder
  • 37,759
  • 6
  • 111
  • 158
  • Thank you Bob for the response. While this works (and please excuse my ignorance) but shouldn't this apply to Firebase console as well? I have always interacted with https://console.firebase.google.com rather than Cloud console and your suggested step to "click the check box" cannot be replicated. I have provided a screenshot of a sample project to study. It is not possible to select multiple functions or even delete a function. https://i.stack.imgur.com/AfDtg.png – Manish Shrestha Jul 29 '18 at 09:22
7

Just comment (or delete) all the functions in your index.js file and redeploy it through the CLI.

Renaud Tarnec
  • 79,263
  • 10
  • 95
  • 121
  • So its not possible to delete the functions without redeploying? Your solution works but I was looking for a more elegant solution from the firebase team. Thanks. – Manish Shrestha Jul 27 '18 at 13:28
  • 2
    I don't know if there is any other solution. Interested to see what the Firebase team would reply. – Renaud Tarnec Jul 27 '18 at 13:29
  • NOTE! your function logs and graph performance are also deleted. You won't be able to checkout old logs and compare graph between the old and new functions – genericUser May 20 '21 at 13:30
1

Adding other deletion options. For more information, checkout Firebase official documentation.

enter image description here

genericUser
  • 4,417
  • 1
  • 28
  • 73
-1

Now you can simply delete a function from the function dashboard as follows. Click on the three dots mark of relevant function in the right side corner.

enter image description here

isuru
  • 3,385
  • 4
  • 27
  • 62