gcloud alpha billing projects link

NAME
gcloud alpha billing projects link - link a project with a billing account
SYNOPSIS
gcloud alpha billing projects linkPROJECT_ID(--account-id=ACCOUNT_ID    |--billing-account=ACCOUNT_ID)[GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) This command sets or updates the billing account associatedwith a project.

Billing is enabled on a project when the project is linked to a valid, activeCloud Billing account. The billing account accrues charges for the usage ofresources in all of the linked projects. If the project is already linked to abilling account, this command moves the project to the billing account youspecify, updating the billing account that is linked to the project.

Note that associating a project with a closed billing account has the sameeffect as disabling billing on the project: any paid resources in use by theproject are shut down, and your application stops functioning. Unless you wantto disable billing, you should always specify a valid, active Cloud Billingaccount when you run this command. Learn how to confirm the status of a CloudBilling account athttps://cloud.google.com/billing/docs/how-to/verify-billing-enabled#billing_account_status

EXAMPLES
To link a billing account0X0X0X-0X0X0X-0X0X0X with a projectmy-project, run:
gcloudalphabillingprojectslinkmy-project--billing-account=0X0X0X-0X0X0X-0X0X0X
POSITIONAL ARGUMENTS
PROJECT_ID
Specify a project id.
REQUIRED FLAGS
Exactly one of these must be specified:
--account-id=ACCOUNT_ID
(DEPRECATED) Specify a billing account ID. Billing account IDs are of the form0X0X0X-0X0X0X-0X0X0X. To see available IDs, run$gcloud billing accountslist.

The--account-id flag has been renamed--billing-account.

--billing-account=ACCOUNT_ID
Specify a billing account ID. Billing account IDs are of the form0X0X0X-0X0X0X-0X0X0X. To see available IDs, run$gcloud billing accountslist.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

API REFERENCE
This command uses thecloudbilling/v1 API. The full documentationfor this API can be found at:https://cloud.google.com/billing/v1/getting-started
NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudbillingprojectslink
gcloudbetabillingprojectslink

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.