本指南說明如何管理及分離使用 gcloud functions 指令建立的函式。如要瞭解如何管理使用 gcloud run 指令建立的函式,請參閱「管理 Cloud Run 服務」。
使用 Cloud Functions v2 API 建立的函式 (例如,使用 gcloud functions、REST API 或 Terraform) 可透過 Cloud Run Admin API 和 Cloud Functions v2 API 進行管理。舉例來說,您可以使用 gcloud functions 或 gcloud run 指令更新現有函式:
[[["容易理解","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-08-19 (世界標準時間)。"],[[["\u003cp\u003eCloud Functions v2 API functions can be managed using either the Cloud Functions v2 API or the Cloud Run Admin API, allowing for flexibility in deployment and updates via \u003ccode\u003egcloud functions\u003c/code\u003e or \u003ccode\u003egcloud run\u003c/code\u003e commands.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud beta functions detach\u003c/code\u003e command enables the detachment of a Cloud Functions v2 function from its original API environment, transitioning its management exclusively to the Cloud Run Admin API.\u003c/p\u003e\n"],["\u003cp\u003eDetaching a function is irreversible and not applicable to Cloud Run (1st gen) functions, but HTTP functions retain their URLs and event-driven functions retain triggers.\u003c/p\u003e\n"],["\u003cp\u003eDetaching a function to the Cloud Run Admin API changes the billing to the Cloud Run SKU, and modifies the retry settings for event-driven functions to ensure a maximum of five delivery attempts with the use of a dead letter queue for undelivered messages.\u003c/p\u003e\n"],["\u003cp\u003eFollowing a successful detach operation, a new Cloud Run revision of the function is created, marking the point from which the function will be managed and billed through the Cloud Run framework.\u003c/p\u003e\n"]]],[],null,[]]