Goal
I'm updating the service_account keys and storing them as Firebase Environmental Variables.
Error
When I run firebase deploy --only functions I see:
Silver-Sliver:Issy dchaddportwine$ firebase deploy --only functions
=== Deploying to 'development-is'...
i deploying functions
i functions: ensuring necessary APIs are enabled...
✔ functions: all necessary APIs are enabled
i functions: preparing functions directory for uploading...
Error: Error occurred while parsing your function triggers.
Error: Failed to parse private key: Error: Invalid PEM formatted message.
Issue
Updating with firebase functions:config:set introduces extra \ characters to the string. This is what I see in the terminal after applying :set to the private_key_id. See the extra backslashes, where \n becomes \\n?
Silver-Sliver:Issy dchaddportwine$ firebase functions:config:set service_account.private_key_id="-----BEGIN PRIVATE KEY-----\nMIIE...L5A==\n-----END PRIVATE KEY-----\n"
✔ Functions config updated.
Please deploy your functions for the change to take effect by running firebase deploy --only functions
Silver-Sliver:Issy dchaddportwine$ firebase functions:config:get
{
"service_account": {
"private_key_id": "-----BEGIN PRIVATE KEY-----\\nMIIE...L5A==\\n-----END PRIVATE KEY-----\\n",
Question
Is this addition of slashes a bug, or it is user error on my part. Should I be updating the private_key_id differently? How do I solve this?