Home > other >  Which Roles are needed in IAM in order to do a firebase deploy
Which Roles are needed in IAM in order to do a firebase deploy

Time:01-08

I'm trying to add the needed roles for a CI pipeline to automatically deploy to firebase (by running firebase deploy.

The roles I've added so far are:

  • API Keys viewer
  • Artifact registry writer
  • Cloud build Service Account
  • Cloud Functions Admin
  • Cloud Run Viewer
  • Firebase App distribution admin
  • Firebase Authentication admin
  • firebase hosting admin
  • firebase rules admin
  • service account user
  • service usage admin

Honnestly at this point I'm just adding what sounds good, as the error message is not helpful:

There was an issue deploying your functions. Verify that your project has a Google App Engine instance setup at https://console.cloud.google.com/appengine and try again. If this issue persists, please contact support.

It works when adding the Owner permission, so this is a permission issue.

CodePudding user response:

As you want to deploy the entire project, the most applicable role would be Firebase Admin.

I use it in portuguese, so the translation in english may be different.

CodePudding user response:

For deploying the hosting app IAM role must be either an Owner or Editor. Sometimes updating the latest version of a Node Package/Firebase tool will resolve the issue as per my experience.

npm install -g firebase-tools

It will provide the globally accessible firebase command. For reference: https://firebase.google.com/docs/projects/iam/roles

For any deployments, you need the first Firebase token which is GCP_SA_key for whatever you want to deploy or update.

There are different scenarios let me elaborate with reference

  • Cloud Functions Developer IAM role for deploying functions
  • Cloud Scheduler Admin IAM role for scheduling your functions
  • Service Account User IAM role By default service account using the APP engine for the deployments process required a service account user role.

You need more roles for Updating Firestore to update rules, indexes, and files.

  • Firebase Rules Admin role for updating Firestore rules.
  • Cloud Datastore Index Admin role for updating firestore Indexes.
  • Firebase Hosting Admin role for updating files. Further details reference added :GitHub Integration/deployments roles
  • Related