Change the billing account of all your GCP projects at once

If you are using GCP, you may at one point need to change the billing account associated with all your projects. This “billing account migration” can happen for a number of reasons, but a common one is the consolidation of several existing billing accounts under a new one. Below, you’ll find a small script to allow you to do that quickly. This script takes all the projects linked to one billing account and reassigns them to a new one.