Administra funciones en el lugar de trabajo de Shell
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
En esta página, se muestra cómo administrar varias configuraciones de
Cloud Functions en un
solo espacio de trabajo y cómo reorganizar el explorador de funciones de Cloud Run con
Cloud Code.
Antes de comenzar
Esta guía requiere un lugar de trabajo ya configurado (un archivo launch.json con al menos una configuración registrada). Para comenzar con una muestra, consulta la guía de inicio rápido sobre cómo crear e implementar una función.
Administra varias configuraciones en un solo espacio de trabajo
Para agregar una nueva configuración de Cloud Function a tu archivo launch.json, sigue estos pasos:
Haz clic en Cloud Code y, luego, expande el explorador de Cloud Functions.
En el explorador de funciones de Cloud Run, haz clic con el botón derecho en WORKSPACE y, luego, en Add new cloud function configuration.
Sigue las indicaciones y realiza las siguientes acciones:
Ingresa un nombre de función
Selecciona un entorno de Cloud Run Functions
Ingresa un punto de entrada (el nombre del método al que se llamará para esta función).
Ingresa la entrada de prueba
También puedes ingresar estos valores de forma manual en el archivo launch.json:
Tu lugar de trabajo de funciones de Cloud Run corresponde a la primera
configuración que aparece en tu archivo launch.json. El nombre del lugar de trabajo refleja el functionName de la primera configuración que aparece en el archivo launch.json:
Opcional: Para implementar otra configuración desde tu archivo launch.json, mueve la configuración que deseas implementar a la parte superior del archivo launch.json y haz clic en ActualizarActualizar el explorador de Cloud Functions.
Reorganiza el explorador de funciones de Cloud Run en el explorador de archivos de tu IDE
Para reorganizar el explorador de funciones de Cloud Run en el explorador de archivos de Cloud Shell, haz lo siguiente:
Arrastra el Explorador de funciones de Cloud Run al Explorador de archivos de Cloud Shell:
Con esta disposición, se muestra el Explorador de funciones de Cloud Run en el
explorador de archivos para que puedas ver las funciones implementadas y
los espacios de trabajo de las funciones de Cloud Run en el mismo panel que los archivos de tu proyecto.
De manera opcional, para deshacer esta disposición, arrastra el título del explorador Cloud Code: Cloud Functions al explorador Cloud Code.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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."]]