google-cloud-platformgoogle-bigquerygoogle-cloud-billing

Export billing Data to Bigquery for all projects in GCP


I have been working on enabling the billing exports to Bigquery. I know the process to set it up based on the documentation but looks like I can set it up for only one project at a time. There are close of 70 projects in GCP and need to load the billing data for all the projects to big query and create a billing report to see the expensive projects and its services. My questions are

  1. how can I configure the billingexport for all projects at a single time?
  2. how can I get access to historical billing data?

Kindly answer my questions. Appreciate your help.

Thanks!


Solution

  • how can I configure the billingexport for all projects at a single time?

    Billing export to BigQuery is based upon the billing account. Enable billing export for each billing account. If you have different billing accounts per project, then you must enable export for each billing account.

    how can I get access to historical billing data?

    Billing data in BiqQuery is only available after you enable export to BigQuery and after waiting for the export to start. Previous data is not exported to BigQuery. For that reason, it is recommended to enable billing export at the time you create a billing account.

    Another recommendation is to create a new project to hold the billing data.

    For more details on the individual steps:

    Set up Cloud Billing data export to BigQuery