Cloud Run Admin API (建議):使用此 API 建立的函式 (例如使用Google Cloud 主控台、gcloud run、REST API 或 Terraform) 只能透過 Cloud Run Admin API 管理。
Cloud Functions v2 API:使用這個 API 建立的函式 (例如,使用 gcloud functions、REST API 或 Terraform) 可透過 Cloud Run Admin API 和 Cloud Functions v2 API 進行管理。使用這個 API 時,您可以在部署函式時指定觸發事件。瞭解如何分離 v2 API 函式,以便專門使用 Cloud Run Admin API 管理該函式。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Compare Cloud Run functions\n\nThis guide compares the latest and original Google Cloud choices for deploying\nfunctions. This page helps those who previously created functions with the\n[Cloud Functions API](/functions/docs/reference/rest) and are transitioning to the\nCloud Run Admin API. This page describes key differences in several areas,\nsuch as concepts, configuration, deployment, and triggers and retries.\n\nComparison\n----------\n\nThere are two versions of Cloud Run functions:\n\n- **Cloud Run functions** , is the latest version of functions,\n [deployed as a service on Cloud Run](/run/docs/resource-model#functions).\n They can be created in one of the following ways:\n\n - [Cloud Run Admin API](/run/docs/reference/cloud-run-admin-api-overview) (Recommended): Functions created with this API (for example, by using Google Cloud console, `gcloud run`, the REST API, or Terraform) can be managed exclusively using the Cloud Run Admin API.\n - [Cloud Functions v2 API](/functions/docs/reference/rest): Functions created with this API (for example, by using `gcloud functions`, the REST API, or Terraform) can be managed with the Cloud Run Admin API as well as the Cloud Functions v2 API. When using this API, you specify the trigger when deploying your function. Learn how to [detach](/functions/docs/managing#detach) a v2 API function so that it can be managed exclusively using the Cloud Run Admin API.\n- **Cloud Run functions (1st gen)** ,\n formerly known as Cloud Functions (1st gen), is the original version of\n functions with limited event triggers, runtimes, and configurability.\n [Learn more](/functions/1stgendocs/concepts/overview).\n\nBy deploying functions directly onto Cloud Run, your functions\nare automatically built as containers and deployed as a Cloud Run\nservice.\n\n### Concepts\n\nThe following table summarizes the conceptual differences for functions.\n\n### Configuration\n\nCloud Run builds functions into containers and deploys them as\nservices. When you deploy a function to Cloud Run, you have\ncomplete access and control over the function's behavior. For example, you can\nenable Direct VPC, configure GPUs, use volume mounts, and more.\n\nThe following table summarizes the configuration differences for functions:\n\n### Deployment\n\nSince August 2024, you can use Cloud Run to deploy and manage\nfunctions created with the Cloud Functions v2 API. As a result of this change:\n\n- Function metadata such as runtime ID and build configurations are stored in the Cloud Run service definition.\n- You can safely edit your function using the Cloud Run Admin API.\n- You can rely on the Cloud Run service definition as the source of truth for your function.\n\nHowever, note that functions created with the Cloud Run Admin API cannot be\nmodified with the Cloud Functions API.\n\nThe following table summarizes the differences in how you create, deploy, edit,\nand manage functions:\n\n### Triggers and retries\n\nThe following table compares triggers and retries for functions:\n\nDetach your function\n--------------------\n\nFunctions created using the [Cloud Functions v2 API](/functions/docs/apis)\n(for example, by using `gcloud functions`, the REST API, or Terraform) can be\ndetached from its existing API environment. After you detach a function, you can\nonly manage it using the\n[Cloud Run Admin API](/run/docs/reference/cloud-run-admin-api-overview). You might\nwant to do this if your workloads need to stay within the\n`run.googleapis.com` API boundary for\n[Assured Workloads](/assured-workloads/docs/overview), or to ensure\nthat your workloads use the [Cloud Run SKU](/skus/sku-groups/cloud-run).\nSee [Manage functions](/functions/docs/managing) to learn more.\n\nWhat's next\n-----------\n\n- Try the getting started guide for [deploying a Cloud Run function](/run/docs/quickstarts/functions/deploy-functions-console)."]]