Question

Difficulty: Very hardConfiguring Billing Accounts and Linking Projects

A Google Cloud administrator needs to migrate an existing project (`corp-analytics-prod`) from a legacy billing account to a newly established billing account (`01A2B3-4C5D6E-7F8901`) using the Google Cloud CLI (`gcloud`). The administrator has already been granted `roles/billing.projectManager` on the project and `roles/billing.user` on the target billing account. Which sequence of operations must the administrator execute to identify the new billing account ID, link the project to the new billing account, and verify the successful linkage?

  1. 1Execute `gcloud billing accounts list` to identify and copy the Account ID for the target Cloud Billing account.
  2. 2Execute `gcloud billing projects describe corp-analytics-prod` to view the project's baseline billing status and current billing account assignment.
  3. 3Execute `gcloud billing projects link corp-analytics-prod --billing-account=01A2B3-4C5D6E-7F8901` to bind the project to the target billing account.
  4. 4Execute `gcloud billing projects describe corp-analytics-prod` to confirm that `billingAccountId` matches `01A2B3-4C5D6E-7F8901` and `billingEnabled` is `true`.

Answer

The correct execution order requires first discovering the target Cloud Billing account ID, then describing the project to record its baseline state, followed by running the link command with the target billing account ID, and finally running describe again to verify that the project billing account ID and billing status have updated.
The proper administrative workflow begins by listing accessible billing accounts to obtain the exact target billing account ID. Next, describing the project provides a baseline view of current billing settings. Running `gcloud billing projects link` applies the new billing account binding. Finally, re-describing the project confirms that the `billingAccountId` field reflects the new ID and that `billingEnabled` is set to `true`.

Step-by-Step Solution

1
Run `gcloud billing accounts list`
Returns all Cloud Billing accounts accessible by the current IAM identity, revealing the ID `01A2B3-4C5D6E-7F8901`.
You must obtain the exact billing account ID before attempting CLI binding operations.
2
Run `gcloud billing projects describe corp-analytics-prod`
Displays current project billing metadata including existing `billingAccountId` and `billingEnabled: true`.
Establishing a baseline state allows confirmation of existing billing linkage prior to modification.
3
Run `gcloud billing projects link corp-analytics-prod --billing-account=01A2B3-4C5D6E-7F8901`
Links the target project to the specified billing account.
This is the primary administrative step required to associate the Google Cloud project with the new billing account using least-privilege roles (`roles/billing.projectManager` on the project and `roles/billing.user` on the billing account).
4
Run `gcloud billing projects describe corp-analytics-prod`
Outputs `billingAccountId: 01A2B3-4C5D6E-7F8901` and `billingEnabled: true`.
Verification confirms that the asynchronous or synchronous binding completed successfully and billing status remains active.

Key Concept

Managing Google Cloud project billing account links via `gcloud billing projects` CLI commands requires appropriate IAM roles (`roles/billing.projectManager` or `roles/billing.admin` on project, and `roles/billing.user` on billing account) and proper operational sequence.
Rate this question