Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

firebase-deploy don't use project_id in KEY_FILE

Edited

When using KEY_FILE option, service account key file includes project_id, but firebase-deploy doesn't seem to use it. So we have to specify PROJECT_ID independently.

 

2 answers

0 votes

@MasaGon actually you may not specify the project. It is good practise to specify the project you want to deploy to in .firebaserc file and this option is also available in firebase-deploy pipe.

Regarding key file, it is used for authentication and just confirms that you can deploy to the exact project.

.filebaserc may have multiple projects like this. So, detecting project with KEY_FILE is the most reasonable way when using KEY_FILE, I think.

{

  "projects": {

    "default": "some-project1",

    "development": "some-project2",

    "staging": "some-project3",

    "production": "some-project4"

  }

}

 

@MasaGon yes, KEY_FILE is used to authenticate as well as FIREBASE_TOKEN, and need to be generated on gcp site as key for service role with appropriate permissions, you can also specify there which project may be accessed.

 

Explain if you have another format for this authentication and want to use key file for  specific project id, so if you specify another project, it will fail with 403 forbidden error?

Or do you have another need for your pipeline?

 

Best regards, Galyna

KEY_FILE format is like this. You can see project_id is included. So I don't understand why you have to specify PROJECT_ID separately. We use multiple project for each production, staging and development environment. On some case, deployment is failed without PROJECT_ID. I think PROJECT_ID is unnecessary when KEY_FILE is specified.

{
"type": "service_account",
"project_id": "******************",
"private_key_id": "******************",
"private_key": "-----BEGIN PRIVATE KEY-----*****************-----END PRIVATE KEY-----\n",
"client_email": "***************",
"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": "https://www.googleapis.com/robot/v1/metadata/x509/*******************"
}

 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

144 views 1 12
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you