LoginSignup
4
3

More than 1 year has passed since last update.

「Permission 'iam.serviceAccounts.signBlob' denied on resourceエラー」の解決方法

Posted at

はじめに

Firebase Functionsで次の処理を定義していました。

const bucket = this.storage.bucket(bucketName);
const file = bucket.file(fileName);
file.getSignedUrl({
    action: 'read',
    expires: '03-09-2491',
});

権限エラーの発生

そして、該当の呼び出し可能関数を実行した結果、次のようなエラーが発生しました。

Permission 'iam.serviceAccounts.signBlob' denied on resource (or it may not exist).

解決方法

プロジェクト名@appspot.gserviceaccount.comというプリンシパルに対してサービス アカウント トークン作成者のロールを付与することで解決しました。

Firebase Functionsの呼び出し関数で上記のエラーが発生したため、firebase-adminsdk-xxx@プロジェクト名.iam.gserviceaccount.comに対してロールを付与すべきかと思ったのですが、すでにそのロールは付与済みだったにも関わらずこのエラーが発生していました。

そのため、いろいろ調べてみた結果、プロジェクト名@appspot.gserviceaccount.comというプリンシパルに対してロールを付与することで解決することがわかりました。

参考にした記事

4
3
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
4
3