0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CloudFunctionsでfirebase-adminを用いているのにpermission_deniedが表示される

Posted at

Typescriptでcloudfuntionsのコードを書いている時、firebase-adminを用いているのにも関わらずPERMISSION_DENIEDが表示される。

index.tsの中身

import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
admin.initializeApp(functions.config().firebase);

実行したコード

firebase emulators:start

エラー

Error: 7 PERMISSION_DENIED: Missing or insufficient permissions. at callErrorFromStatus

解決方法

  1. サービスアカウントのキーを作成する
  2. そのキーを環境変数に設定する
    export GOOGLE_APPLICATION_CREDENTIALS="path/to/key.json"

参考

ローカルでの関数の実行

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?