Cloud Runにデプロイしたら403になる場合の対処法

Cloud Runにデプロイして以下のように403になった場合。

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 Run サービスは、デフォルトで非公開にデプロイされているのが原因。 リクエストで認証情報を提供しないと、サービスにアクセスできない。

設定方法とかは以下の記事に。