Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Auf dieser Seite erfahren Sie, wie Sie mehrere Cloud Functions-Konfigurationen in einem einzigen Arbeitsbereich verwalten und den Cloud Run Functions Explorer mit Cloud Code neu anordnen.
Hinweis
Für diesen Leitfaden ist ein bereits eingerichteter Arbeitsbereich erforderlich (eine launch.json-Datei mit mindestens einer Konfiguration). Eine Beispielfunktion finden Sie in der Kurzanleitung zum Erstellen und Bereitstellen einer Funktion.
Mehrere Konfigurationen in einem einzigen Arbeitsbereich verwalten
So fügen Sie Ihrer launch.json-Datei eine neue Cloud Functions-Konfiguration hinzu:
Klicken Sie auf Cloud Code und maximieren Sie dann den Explorer von Cloud Functions.
Klicken Sie im Cloud Run-Funktions-Explorer mit der rechten Maustaste auf WORKSPACE und dann auf Add new cloud function configuration (Neue Cloud-Funktionskonfiguration hinzufügen).
Folgen Sie der Anleitung und führen Sie die folgenden Schritte aus:
Geben Sie einen Funktionsnamen ein.
Cloud Run-Funktionsumgebung auswählen
Geben Sie einen Einstiegspunkt ein (den Namen der Methode, die für diese Funktion aufgerufen werden soll).
Testeingabe eingeben
Alternativ können Sie diese Werte auch manuell in die launch.json-Datei eingeben:
Ihr Cloud Run-Funktionsarbeitsbereich entspricht der ersten Konfiguration in Ihrer launch.json-Datei. Der Name des Arbeitsbereichs entspricht der functionName der ersten Konfiguration, die in der Datei launch.json aufgeführt ist:
Optional: Wenn Sie eine andere Konfiguration aus Ihrer launch.json-Datei bereitstellen möchten, verschieben Sie die Konfiguration, die Sie bereitstellen möchten, an den Anfang der launch.json-Datei und klicken Sie auf AktualisierenCloud Functions Explorer aktualisieren.
Cloud Run-Funktionen im Datei-Explorer der IDE neu anordnen
Sie können den Cloud Run Functions-Explorer im Datei-Explorer von Cloud Shell neu anordnen. Gehen Sie dazu so vor:
Ziehen Sie den Cloud Run Functions Explorer in den Datei-Explorer von Cloud Shell:
Bei dieser Anordnung wird der Cloud Run Functions Explorer im Datei-Explorer angezeigt, sodass Sie Ihre bereitgestellten Funktionen und Cloud Run Functions-Arbeitsbereiche im selben Bereich wie Ihre Projektdateien sehen können.
Optional: Wenn Sie diese Anordnung rückgängig machen möchten, ziehen Sie die Überschrift des Cloud Code: Cloud Functions-Explorers zurück in den Cloud Code-Explorer.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-05 (UTC)."],[[["\u003cp\u003eThis page explains how to manage multiple Cloud Functions configurations within a single workspace using Cloud Code.\u003c/p\u003e\n"],["\u003cp\u003eNew Cloud Function configurations can be added to the \u003ccode\u003elaunch.json\u003c/code\u003e file either by using the Cloud Functions Explorer interface or by manually editing the file.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Run functions workspace displayed is determined by the first configuration listed within your \u003ccode\u003elaunch.json\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eUsers have the option to rearrange the Cloud Run functions Explorer to be integrated into the file explorer of their IDE, allowing for simultaneous viewing of functions and project files.\u003c/p\u003e\n"],["\u003cp\u003eIt also offers the ability to set what configuration to deploy by moving it to the top of the \u003ccode\u003elaunch.json\u003c/code\u003e file and then refreshing the explorer.\u003c/p\u003e\n"]]],[],null,["# Manage functions in Shell workspace\n\nThis page shows you how to manage multiple\n[Cloud Functions](https://cloud.google.com/functions/) configurations in a\nsingle workspace and how to rearrange your Cloud Run functions Explorer with\nCloud Code.\n\nBefore you begin\n----------------\n\nThis guide requires a workspace already setup (a `launch.json` file with at\nleast one configuration listed). To get started with a sample, see the\n[Create and deploy a function](/code/docs/shell/create-deploy-function)\nquickstart.\n\nManage multiple configurations in a single workspace\n----------------------------------------------------\n\nTo add a new Cloud Function configuration to your `launch.json` file, follow\nthese steps:\n\n1. Click **Cloud Code** and then expand the **Cloud Functions** Explorer.\n\n2. In the Cloud Run functions Explorer,\n right-click **WORKSPACE** and click\n **Add new cloud function configuration**.\n\n3. Follow the prompts and perform the following actions:\n\n 1. Enter a function name\n 2. Select a Cloud Run functions environment\n 3. Enter an entry point (the name of the method to call for this function)\n 4. Enter the test input\n\n Alternatively, you can manually enter these values into your `launch.json`\n file: \n\n {\n \"configurations\": [\n {\n \"name\": \"Deploy Cloud Function\",\n \"type\": \"cloudcode.cloudfunctions\",\n \"request\": \"launch\",\n \"functionName\": \"hello-world-get\",\n \"gen\": \"GEN_2\",\n \"entryPoint\": \"helloGet\"\n }\n ]\n }\n\n Your Cloud Run functions workspace corresponds to the first\n configuration listed in your `launch.json` file. The workspace name reflects\n the `functionName` of the first configuration listed in your `launch.json`\n file: \n\n {\n \"configurations\": [\n {\n \"name\": \"Deploy Cloud Function\",\n \"type\": \"cloudcode.cloudfunctions\",\n \"request\": \"launch\",\n \"functionName\": \"hello-world-pub-sub\",\n \"gen\": \"GEN_2\",\n \"entryPoint\": \"helloPubSub\"\n },\n {\n \"name\": \"Deploy Cloud Function\",\n \"type\": \"cloudcode.cloudfunctions\",\n \"request\": \"launch\",\n \"functionName\": \"hello-world-get\",\n \"gen\": \"GEN_2\",\n \"entryPoint\": \"helloGet\"\n }\n ]\n }\n\n4. (Optional) To deploy another configuration from your `launch.json` file, move\n the configuration you want to deploy to the top of the `launch.json` file and\n click refresh\n **Refresh Cloud Functions Explorer**.\n\nRearrange Cloud Run functions Explorer into your IDE's file Explorer\n--------------------------------------------------------------------\n\nYou can rearrange your Cloud Run functions Explorer into\n\nCloud Shell's file Explorer by performing the following:\n\n1. Drag your Cloud Run functions Explorer into\n\n Cloud Shell's file Explorer:\n\n\n This arrangement displays your Cloud Run functions Explorer under the\n file Explorer so that you can view your deployed functions and\n Cloud Run functions workspace(s) in the same pane as your project files.\n2. (Optional) To undo this arrangement, drag the\n **Cloud Code: Cloud Functions** Explorer's heading back to the **Cloud Code**\n Explorer."]]