Firebase Deploy Error: Authorization failed

If you created your project in the fireabse website account, during firebase deployment we need to select that firebase project for hosting. Also if you created more than one project in the firebase account, we need to select one project for the deployment process. For that you need to run the below command.

firebase use --add

It will list multiple project and you can choose one from that option. Then run firebase deploy.


I had this issue because I created and used an alias with firebase use --add then manually removed it from the .firebaserc. The solution was to run firebase use $alias where $alias is the alias of your project. EG: firebase use default


Follow the next steps :

firebase projects:list

Result :

┌──────┬───────────────────────┬─────────────┐
│ Name │ Project ID / Instance │ Permissions │
├──────┼───────────────────────┼─────────────┤
│ itest │ chrome-epigram-510    │ O       │
└──────┴───────────────────────┴─────────────┘

Use command :

firebase use chrome-epigram-510

Result : Now using project chrome-epigram-510

Use command

firebase deploy

Result
=== Deploying to 'chrome-epigram-510'...

i  deploying hosting                                                                     
i  hosting[chrome-epigram-510]: beginning deploy...                                      
i  hosting[chrome-epigram-510]: found 9 files in dist/icrm                               
+  hosting[chrome-epigram-510]: file upload complete                                     
i  hosting[chrome-epigram-510]: finalizing version...                                    
+  hosting[chrome-epigram-510]: version finalized                                        
i  hosting[chrome-epigram-510]: releasing new version...                                 
+  hosting[chrome-epigram-510]: release complete                                         
                                                                                         
+  Deploy complete!    

                                                             

Hosting URL: https://chrome-epigram-510.firebaseapp.com


I was also facing same issue but I logged out and then logeed in again its working fine now

to logout in command line firebase logout to login again type firebase login