I am trying to deploy my cloud functions in GCP and post deployment it is linked to a default service account. However, I have provided values for specific service account on which it should get deployed/linked.
I am using
const admin = require('firebase-admin');
admin.initializeApp({
credential: admin.credential.cert("path to serviceAccount.json")
});
Service account Json (removed keys for some obvious reasons)
{
"type": "service_account",
"project_id": "[PROJECT_ID]",
"private_key_id": "xxxx",
"private_key": "-----BEGIN PRIVATE KEY-----\n[KEY_IS_HERE]\n-----END PRIVATE KEY-----\n",
"client_email": "[CLIENT_EMAIL]",
"client_id": "[CLIENT_ID]",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "[CLIENT_CERT_URL]"
}
Once Functions are deployed, they are linked to the default service account xyz@appspot.gserviceaccount.com
However the keys are provided for mnq@someServiceAccount.com
I need suggestions on what needs to be done to deploy on some specific service account and not on default one.