Creating a key via gcloud iam service-accounts keys create does NOT immediately make it available to use with gcloud commands. Execute the gcloud iam service-accounts disable command to disable a service account. Check your iat and exp values and use a clock with skew to account for clock differences between systems. How can i change the current running project to another project in GCP (Google Cloud Platform) account using cli commands other than using gcloud init manually. gcloud auth list to see what accounts there are credentials for; it should list your service account. Command: gcloud iam service-accounts disable sa-name@project-id.iam.gserviceaccount.com Output: Disabled service account sa-name@project-id.iam.gserviceaccount.com REST API. Don't have an account? There are many use cases for using gcloud with a service account. ERROR: (gcloud.auth.activate-service-account) The .json key file is not in a valid format. Use the serviceAccounts.disable() method. You indeed need to activate via gcloud auth activate-service-account. Use. gcloud auth list to view your set of credentials. Preferably without littering the file system with credentials files, which is what gcloud auth activate-service-account --key-file=... does.
Sign in with Google. You can view your current settings by running I want to change the current project to any other project from the list using a … $gcloud projects list will list the projects running on my account.
Moreover gcloud uses currently active credentials. There are many use cases for using gcloud with a service account. Your current active account [account@gmail.com] does not have any valid credentials.Please run: $ gcloud auth login to obtain new credentials, or if you have already logged in with a different account: $ gcloud config set account ACCOUNT to select an already authenticated account to use. Sign in with Facebook. Preferably without littering the file system with credentials files, which is what gcloud auth activate-service-account --key-file=... does. ERROR: (gcloud.auth.activate-service-account) There was a problem refreshing your current auth tokens: invalid_grant: Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. What is the simplest way to use the gcloud command line non-interactively with a Service Account outside of GCE? What is the simplest way to use the gcloud command line non-interactively with a Service Account outside of GCE?