LoginSignup
7
4

More than 5 years have passed since last update.

GAE/Go 複数アカウントの追加・切り替えと goapp deploy での403エラーを取り除くまで

Posted at

開発環境の前提

  • Windows10 x64
  • Google Cloud Platform SDK インストール済み
  • Google App Engine SDK for Go インストール済み

gcloud.png

gae.png

アカウントの追加

activeアカウントの確認

> gcloud auth list
Credentiald accounts:
 - first-account@gmail.com (active)

first-account@gmailのアカウントがアクティブであることを確認。

アカウントを追加する

> gcloud auth login

ブラウザが開きます。
追加したいアカウントでログインします。ログイン完了でターミナルに制御が戻りアカウントの追加が完了します。

> gcloud auth list
Credentiald accounts:
 - first-account@gmail.com (active)
 - second-account@gmail.com

上記の状態でOK。

activeアカウントの切り替え

> gcloud config set account second-account@gmail.com
>
> gcloud auth list
Credentiald accounts:
 - first-account@gmail.com
 - second-account@gmail.com (active)

goapp deploy 時の403 Errorの解決

> cd %USERPROFILE%
> dir

この位置の以下のファイルを削除する。
- .appcfg_oauth2_tokens
- .appcfg_nag

その後、あらためてgoapp deploy
ログイン状態のキャッシュが無くなっているので、初回のみブラウザに遷移してログインを求められます。追加したsecond-account@gmail.comでログインすればOK。

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