GCLOUD_AUTH_ACTIVATE-SERVICE-ACCOUNT(1)

NAME

gcloud auth activate-service-account - authorize access to Google Cloud Platform using a service account

SYNOPSIS

gcloud auth activate-service-account [ACCOUNT] --key-file=KEY_FILE [--password-file=PASSWORD_FILE | --prompt-for-password] [GCLOUD_WIDE_FLAG ...]

DESCRIPTION
Adds service account credentials from a file that contains a private authorization key to the existing set of credentials managed and used by gcloud. The key file for this command can be obtained using either:

    •   the Cloud Platform console (https://console.cloud.google.com) or

    •   $ gcloud iam service-accounts keys create.

The key file can be .json (preferred) or .p12 (legacy) format. For legacy .p12 files, a separate password might be required. This password is displayed in the console when you create the key. The credentials will also be activated, which is same as running $ gcloud config set account ACCOUNT_NAME. If you specify a project using the --project flag, the project is set in your active configuration, which is same as running $ gcloud config set project PROJECT_NAME. Any previously active credentials will still be retained, and can be seen by running $ gcloud auth list. They will just no longer be the active/default credentials. If you want to delete previous credentials see gcloud auth revoke command. Note: Service accounts use client quotas for tracking usage.

POSITIONAL ARGUMENTS

    [ACCOUNT]
        E-mail address of the service account.

REQUIRED FLAGS

    --key-file=KEY_FILE
        Path to the private key file.

OPTIONAL FLAGS
At most one of these may be specified:

    --password-file=PASSWORD_FILE
        Path to a file containing the password for the service account private key (only for a .p12 file).

    --prompt-for-password
        Prompt for the password for the service account private key (only for a .p12 file).

GCLOUD WIDE FLAGS
These flags are available to all commands: --account, --configuration, --flatten, --format, --help, --log-http, --project, --quiet, --trace-token, --user-output-enabled, --verbosity. Run $ gcloud help for details.