gcloud alpha functions upgrade Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha functions upgrade - upgrade a 1st gen Cloud Function to the Cloud Run function
- SYNOPSIS
gcloud alpha functions upgrade(NAME:--region=REGION)[--abort|--commit|--redirect-traffic|--rollback-traffic|--setup-config--trigger-service-account=TRIGGER_SERVICE_ACCOUNT][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Upgrade a 1st gen Cloud Function to the Cloud Run function.- EXAMPLES
- To start the upgrade process for a 1st gen function
fooand createa Cloud Run function copy, run:gcloudalphafunctionsupgradefoo--setup-configOnce you are ready to redirect traffic to the Cloud Run function copy, run:
gcloudalphafunctionsupgradefoo--redirect-trafficIf you find you need to do more local testing you can rollback traffic to the1st gen copy:
gcloudalphafunctionsupgradefoo--rollback-trafficOnce you're ready to finish upgrading and delete the 1st gen copy, run:
gcloudalphafunctionsupgradefoo--commitYou can abort the upgrade process at any time by running:
gcloudalphafunctionsupgradefoo--abort - POSITIONAL ARGUMENTS
- Function resource - The Cloud Function name to upgrade. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
NAMEon the command line with a fullyspecified name; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
NAME- ID of the function or fully qualified identifier for the function.
To set the
functionattribute:- provide the argument
NAMEon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--region=REGION- The Cloud region for the function. Overrides the default
functions/regionproperty value for this command invocation.To set the
regionattribute:- provide the argument
NAMEon the command line with a fullyspecified name; - provide the argument
--regionon the command line; - set the property
functions/region.
- provide the argument
- provide the argument
- Function resource - The Cloud Function name to upgrade. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
- FLAGS
- Upgrade a 1st gen Cloud Function to the 2nd gen environment. You must specifyone of the following flags:
--setup-configand optionally--trigger-service-account,--redirect-traffic,--rollback-traffic,--commit,--abort.
--abort- Undoes all steps of the upgrade process done so far. All traffic will point tothe original 1st gen function copy and the 2nd gen function copy will bedeleted.
--commit- Finishes the upgrade process and permanently deletes the original 1st gen copyof the function.
--redirect-traffic- Redirects production traffic to the 2nd gen copy of the function.
--rollback-traffic- Rolls back production traffic to the original 1st gen copy of the function. The2nd gen copy will still be available for testing.
--setup-config- Sets up the function upgrade config by creating a 2nd gen copy of the function'scode and configuration.
--trigger-service-account=TRIGGER_SERVICE_ACCOUNT- The email address of the IAM service account associated with the Eventarctrigger for the function. This is used for authenticated invocation.
If not provided, the function will use the project's default service account forCompute Engine.
- Upgrade a 1st gen Cloud Function to the 2nd gen environment. You must specifyone of the following flags:
- 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 helpfor details. - 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. This variant is also available:
gcloudbetafunctionsupgrade
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-08-19 UTC.