【发布时间】:2023-01-24 01:44:34
【问题描述】:
当我部署 firebase 托管时,即使在将项目作为参数传递之后,它也会尝试将 firebase 托管部署到创建服务帐户的项目。
我设置了 GOOGLE_APPLICATION_CREDENTIALS。它指向从另一个项目创建的服务帐户(用于部署的共享服务帐户),并且它具有 Firebase 应用程序分发管理员和当前项目的所有必需权限。
./node_modules/.bin/firebase deploy --only hosting:$ENVIRONMENT --project ${PROJECT_NAME} --non-interactive
Error: HTTP Error: 403, Firebase Hosting API has not been used in project 49XXYYZZ628 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/firebasehosting.googleapis.com/overview?project=497XXYYZZ628 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.
当然,创建服务帐户的项目没有启用 API。
如何强制 firebase 部署通过 firebase 部署命令传递的项目?
我在部署命令之前尝试过
gcloud config set project ${PROJECT_NAME}
firebase use --project ${PROJECT_NAME}
`
【问题讨论】:
标签: firebase