This is the only API I've seen behave like this.
Setting export GOOGLE_APPLICATION_CREDENTIALS=mykey
works but doing gcloud auth activate-service-account --key-file=mykey
and then executing my code I see a perms error:
google.api_core.exceptions.PermissionDenied: 403 Request had insufficient authentication scopes. [reason: "ACCESS_TOKEN_SCOPE_INSUFFICIENT"
domain: "googleapis.com"
metadata {
key: "service"
value: "analyticsadmin.googleapis.com"
}
metadata {
key: "method"
value: "google.analytics.admin.v1alpha.AnalyticsAdminService.ListAccessBindings"
}
]
This is my code:
client = AnalyticsAdminServiceClient(transport=None)
res = client.list_access_bindings(parent=f"accounts/{account}")
Every other API I use honors activated service accounts. Does this API really only support setting the env var?