LoginSignup
0
0

Cloud Functionsを実行時、The request was not authenticatedエラーの対策法

Posted at

Cloud Functionsを検証するときに起きた問題。

専用サービスアカウントを指定し、Pub/Sub トリガーのCloud Functions(第2世代)
トピックにメッセージをパブリッシュすると、Cloud Functionsのログにこういうエラーが出ました。

"The request was not authenticated. Either allow unauthenticated invocations or set the proper Authorization header. Read more at https://cloud.google.com/run/docs/securing/authenticating Additional troubleshooting documentation can be found at: https://cloud.google.com/run/docs/troubleshooting#unauthorized-client"

解決策として、Cloud Functionsのサービスアカウントに関数の実行権限を付与する

gcloud functions add-invoker-policy-binding FUNCTION_NAME \
      --region=REGIN \
      --member=SERVICE_ACCOUNT
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