I'm trying to call the budget API using a service account and a key file but I get this error:
PERMISSION_DENIED: The caller does not have permission
My Code
async function listBillingAccounts() {
const [account] = await client.getBillingAccount({ name: `billingAccounts/${BILLING_ACCOUNT_ID}` });
console.info({ account });
}
listBillingAccounts();
My CLI Setup
gcloud config set project my-project-id
Environment Variables as Mentioned in Their Docs:
| Key | Value |
|---|---|
| GOOGLE_APPLICATION_CREDENTIALS | path\to\gcp-credentials.json |
| GCP_PROJECT | my-project-id |
Service Account Setup
When I go to https://console.cloud.google.com/iam-admin/iam?project=my-project-id, it shows the service account in the table:
| Member | Name | Role | Inheritance |
|---|---|---|---|
| owner-75@my-project-id.iam.gserviceaccount.com | owner | Owner | my-project-id |
I don't know what to do next.