Reputation: 53
I have deployed one function as part of Firebase deploy command and I could see the same in Firebase/Google Cloud console.Is there any way to remove the same functions, as directly removing the functions folder and deploying it again is not actually removing the already deployed functions.
Also I tried disabling the hosting as well, but that also didn't help. Could someone please let us know if there is any command to un-deploy the already deployed functions?
Upvotes: 5
Views: 6151
Reputation: 4466
I assume that deleting is the same as un-deploying?
If so, I have used the command firebase functions:delete myFunc to delete a function named myFunc.
Additional information is available here:
https://firebase.google.com/docs/functions/manage-functions#delete_functions
In the firebase console, on the functions page, there is an icon on the far right you can click to see a menu for deleting items.
Upvotes: 3
Reputation: 10353
You can simply change the function to an empty block and run the deploy command:
exports.myFunc = {}
This will delete the function:
$ firebase deploy
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
i functions: deleting function myFunc...
✔ functions[myFunc]: Successful delete operation.
Upvotes: 2
Reputation:
Using firebase itself, the only way I am aware of is to deploy an empty/do-nothing function, which will overwrite your existing function(s).
You could also do this from the Google cloud functions console. Visit https://console.cloud.google.com/functions/list?project=my-project, find the function you want to delete, click on the three vertical dots at the right, and choose "Delete".
Upvotes: 9