---
title: "POST /v2/{+name}:setupFunctionUpgradeConfig"
method: POST
path: "/v2/{+name}:setupFunctionUpgradeConfig"
tags: ["projects"]
---

# POST /v2/{+name}:setupFunctionUpgradeConfig

`POST /v2/{+name}:setupFunctionUpgradeConfig`

Creates a 2nd Gen copy of the function configuration based on the 1st Gen function with the given name. This is the first step of the multi step process to upgrade 1st Gen functions to 2nd Gen. Only 2nd Gen configuration is setup as part of this request and traffic continues to be served by 1st Gen.

## Path parameters

- `name` string, required

## Request body

- SetupFunctionUpgradeConfigRequest — Request for the `SetupFunctionUpgradeConfig` method.
  - `triggerServiceAccount` string — Optional. The trigger's service account. The service account must have permission to invoke Cloud Run services, the permission is `run.routes.invoke`. If empty, defaults to the Compute Engine default service account: `{project_number}-compute@developer.gserviceaccount.com`.
  - `buildConfigOverrides` BuildConfigOverrides — Contains overrides related to the function's build configuration.
    - `runtime` string — Optional. Specifies the desired runtime for the new Cloud Run function. (e.g., `"nodejs20"`, `"python312"`). Constraints: 1. This field CANNOT be used to change the runtime language (e.g., from `NODEJS` to `PYTHON`). The backend will enforce this. 2. This field can ONLY be used to upgrade the runtime version (e.g., `nodejs18` to `nodejs20`). Downgrading the version is not permitted. The backend will validate the version change. If provided and valid, this overrides the runtime of the Gen1 function.
  - `serviceConfigOverrides` ServiceConfigOverrides — Contains overrides related to the function's service configuration.
    - `maxInstanceCount` integer — Optional. Specifies the maximum number of instances for the new Cloud Run function. If provided, this overrides the max_instance_count setting of the Gen1 function.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/cloudfunctions.md) · [All operations](https://skmtc.dev/google/apis/cloudfunctions/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/cloudfunctions/revisions/3063be097e80/schema)
