GCP: FAILED_PRECONDITION: Key creation is not allowed on this service account (constraints/iam.disableServiceAccountKeyCreation)
An organisation policy forbids creating downloadable JSON keys for service accounts.
Key creation is not allowed on this service accountFAILED_PRECONDITION: Key creation is not allowed on this service accountiam.disableServiceAccountKeyCreation organization policy Meaning
New organisations enforce iam.disableServiceAccountKeyCreation by default. Prefer keyless options: Workload Identity (GKE), Workload Identity Federation (GitHub Actions/AWS), attached service accounts (Cloud Run, GCE) or impersonation. If keys are unavoidable, an Org Policy Administrator must relax the constraint for that project.
Common causes
- Constraint iam.disableServiceAccountKeyCreation enforced
- Secure-by-default organisation policies
- Trying to use keys from CI
- Project inherits org-level policy
- Missing org-policy admin rights to change it
⚡ Quick fix
- Use Workload Identity Federation for CI instead of keys
- Attach a service account to the runtime
- Request a policy exception from an org admin
Detailed fix by platform
gcloud
gcloud resource-manager org-policies describe iam.disableServiceAccountKeyCreation --project PROJECT
How to diagnose
- Policy — Constraint enforced?
- Alternative — Keyless possible?
- Admin — Can change the policy?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- 403: does not have storage.objects.get access Cloud Storage: 403 Forbidden — user@example.com does not have storage.objects.get access to the Google Cloud Storage object
- BigQuery: Access Denied: Project: User does not have bigquery.jobs.create permission BigQuery: Access Denied: Project my-project: User does not have bigquery.jobs.create permission in project my-project
- Cloud Run 403: Your client does not have permission to get URL Cloud Run: Error: Forbidden — Your client does not have permission to get URL / from this server
Most viewed in Google Cloud / Firebase
- Missing or insufficient permissions Firestore: FirebaseError: [code=permission-denied]: Missing or insufficient permissions
- Container failed to start Cloud Run: The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable
- 409: The resource already exists Compute Engine: ERROR: (gcloud.compute.instances.create) Could not fetch resource: The resource 'projects/p/zones/z/instances/vm-1' already exists
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026