HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/help/man/man1/gcloud_alpha_functions_upgrade.1
.TH "GCLOUD_ALPHA_FUNCTIONS_UPGRADE" 1



.SH "NAME"
.HP
gcloud alpha functions upgrade \- upgrade a 1st gen Cloud Function to the Cloud Run function



.SH "SYNOPSIS"
.HP
\f5gcloud alpha functions upgrade\fR (\fINAME\fR\ :\ \fB\-\-region\fR=\fIREGION\fR) [\fB\-\-abort\fR\ |\ \fB\-\-commit\fR\ |\ \fB\-\-redirect\-traffic\fR\ |\ \fB\-\-rollback\-traffic\fR\ |\ \fB\-\-setup\-config\fR\ \fB\-\-trigger\-service\-account\fR=\fITRIGGER_SERVICE_ACCOUNT\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]



.SH "DESCRIPTION"

\fB(ALPHA)\fR Upgrade a 1st gen Cloud Function to the Cloud Run function.



.SH "EXAMPLES"

To start the upgrade process for a 1st gen function \f5foo\fR and create a Cloud
Run function copy, run:

.RS 2m
$ gcloud alpha functions upgrade foo \-\-setup\-config
.RE

Once you are ready to redirect traffic to the Cloud Run function copy, run:

.RS 2m
$ gcloud alpha functions upgrade foo \-\-redirect\-traffic
.RE

If you find you need to do more local testing you can rollback traffic to the
1st gen copy:

.RS 2m
$ gcloud alpha functions upgrade foo \-\-rollback\-traffic
.RE

Once you're ready to finish upgrading and delete the 1st gen copy, run:

.RS 2m
$ gcloud alpha functions upgrade foo \-\-commit
.RE

You can abort the upgrade process at any time by running:

.RS 2m
$ gcloud alpha functions upgrade foo \-\-abort
.RE



.SH "POSITIONAL ARGUMENTS"

.RS 2m
.TP 2m

Function resource \- The Cloud Function name to upgrade. The arguments in this
group can be used to specify the attributes of this resource. (NOTE) Some
attributes are not given arguments in this group but can be set in other ways.

To set the \f5project\fR attribute:
.RS 2m
.IP "\(em" 2m
provide the argument \f5NAME\fR on the command line with a fully specified name;
.IP "\(em" 2m
provide the argument \f5\-\-project\fR on the command line;
.IP "\(em" 2m
set the property \f5core/project\fR.
.RE
.sp

This must be specified.


.RS 2m
.TP 2m
\fINAME\fR

ID of the function or fully qualified identifier for the function.

To set the \f5function\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5NAME\fR on the command line.
.RE
.sp

This positional argument must be specified if any of the other arguments in this
group are specified.

.TP 2m
\fB\-\-region\fR=\fIREGION\fR

The Cloud region for the function. Overrides the default \f5functions/region\fR
property value for this command invocation.

To set the \f5region\fR attribute:
.RS 2m
.IP "\(bu" 2m
provide the argument \f5NAME\fR on the command line with a fully specified name;
.IP "\(bu" 2m
provide the argument \f5\-\-region\fR on the command line;
.IP "\(bu" 2m
set the property \f5functions/region\fR.
.RE
.sp


.RE
.RE
.sp

.SH "FLAGS"

.RS 2m
.TP 2m

Upgrade a 1st gen Cloud Function to the 2nd gen environment. You must specify
one of the following flags:
.RS 2m
.IP "\(em" 2m
\f5\-\-setup\-config\fR and optionally \f5\-\-trigger\-service\-account\fR,
.IP "\(em" 2m
\f5\-\-redirect\-traffic\fR,
.IP "\(em" 2m
\f5\-\-rollback\-traffic\fR,
.IP "\(em" 2m
\f5\-\-commit\fR,
.IP "\(em" 2m
\f5\-\-abort\fR.
.RE
.sp


At most one of these can be specified:


.RS 2m
.TP 2m
\fB\-\-abort\fR

Undoes all steps of the upgrade process done so far. All traffic will point to
the original 1st gen function copy and the 2nd gen function copy will be
deleted.

.TP 2m
\fB\-\-commit\fR

Finishes the upgrade process and permanently deletes the original 1st gen copy
of the function.

.TP 2m
\fB\-\-redirect\-traffic\fR

Redirects production traffic to the 2nd gen copy of the function.

.TP 2m
\fB\-\-rollback\-traffic\fR

Rolls back production traffic to the original 1st gen copy of the function. The
2nd gen copy will still be available for testing.

.TP 2m
\fB\-\-setup\-config\fR

Sets up the function upgrade config by creating a 2nd gen copy of the function's
code and configuration.

.TP 2m
\fB\-\-trigger\-service\-account\fR=\fITRIGGER_SERVICE_ACCOUNT\fR

The email address of the IAM service account associated with the Eventarc
trigger for the function. This is used for authenticated invocation.

If not provided, the function will use the project's default service account for
Compute Engine.


.RE
.RE
.sp

.SH "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 \fB$ gcloud help\fR for details.



.SH "NOTES"

This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. This variant is also available:

.RS 2m
$ gcloud beta functions upgrade
.RE