Search code examples
firebasegoogle-cloud-platformservice-accounts

How to connect Firebase service account to different GCP project


I want to use the Firebase Admin SDK. And I will deploy my server into the GKE. but apparently, when clicking 'service account' from my firebase, it is linked to another 'project' in my GCP

To give an example of it, my whole project in GCP is under a project 'project-a' with an ID of 'project-a-12345678'. my firebase project name is 'project-b' with and id of 'project-b'.

So how can I connect my firebase to my current GKE's project service account?


Solution

  • Firebase projects are Google Cloud projects, that just have some extra metadata attached to them. If you have an existing Firebase project, you can use GKE in that same project by opening it in the Google Cloud console.

    You can also go the other direction and add Firebase features to an existing Google Cloud project. For this, go to the Firebase console, click Add project and then click in the Enter your project name box, it'll show you a list of GCP project that you have that are not associated with Firebase. If you select one of those project, it add the Firebase metadata and you can then use Firebase services on it too.