The caller does not have permission: billing.accounts.get" when running gcloud billing commands
Fixes the permission error on gcloud billing commands. Covers granting the billing viewer role on the billing account, finding the billing account ID, and distinguishing project IAM from billing account IAM. Use when billing commands are denied. Not for budget creation errors.
TL;DR
billing.accounts.get is a billing-account-level permission, and your identity does not hold it there. Grant roles/billing.viewer on the billing account (not on a project), then retry the gcloud command.
ERROR: (gcloud.billing.accounts.list) The caller does not have permission: billing.accounts.getUse this when
gcloud billing accounts listorgcloud billing projects linkis permission-denied.- You can run other gcloud commands fine but billing ones fail.
- A script that manages billing account links breaks with this error.
Not for this skill when
- The command succeeds but returns empty. That can be a different permission shape.
- Budget creation fails. That needs the costs manager role.
Steps
- Find your billing account ID: ask an admin or check the billing section of the console. Verify: you have the ID in the form [billing account id].
- Have a billing admin grant your identity
roles/billing.vieweron that billing account's IAM page. Verify: the grant is on the billing account, not a project. - Re-run the gcloud command. Verify: it returns data instead of the permission error.
- If you need to link projects or manage budgets, viewer is not enough; request
roles/billing.userorroles/billing.costsManagerrespectively. Verify: the new command set works. - For automation, grant the role to the service account the script uses, not to your user. Verify: the script runs clean.
Empty list variant
If the command succeeds but lists nothing, you may have viewer on one account while the projects sit on another. Verify: you are looking at the right billing account ID.
Compatibility: Google Cloud SDK, all billing account types.
Why it happens
Billing accounts sit outside the project hierarchy, and their IAM is separate. Project owners routinely have zero billing permissions, so billing commands fail until someone grants a role at the billing account level.
Edge cases / pitfalls
- There is no self-service way to discover billing account IDs without the permission. You need an admin's help for step one.
- Role changes can take a few minutes to propagate. Wait before retesting.
- Service accounts used by billing export or FinOps tooling need the same grant.
- Do not hand out billing admin to fix a viewer problem. Match the role to the action.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_kpHEdtbV8TTnhk1rLdFbAQ