gcloud iam service-accounts keys create key.json --iam-account deploy-bot@my-project-123456.iam.gserviceaccount.com

Category: Google Cloud & Workspace

gcloud iam service-accounts keys create key.json --iam-account deploy-bot@my-project-123456.iam.gserviceaccount.com

Create a service account key file

Generates a JSON private key for the service account and writes it to key.json, a long-lived credential anyone with the file can use. Treat key files like passwords, store them in a secret manager, and prefer Workload Identity Federation where possible. Delete unused keys with gcloud iam service-accounts keys delete.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.