A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/code/docs/vscode/create-deploy-function below:

Create and deploy a function with Cloud Code for VS Code

Skip to main content Create and deploy a function with Cloud Code for VS Code

Stay organized with collections Save and categorize content based on your preferences.

This page shows you how to create, download, deploy, and invoke a 2nd gen HTTP function using Cloud Functions with Cloud Code.

Before you begin
  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Cloud Functions, Cloud Build, Artifact Registry, Cloud Run, Logging, and Pub/Sub APIs.

    Enable the APIs

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Cloud Functions, Cloud Build, Artifact Registry, Cloud Run, Logging, and Pub/Sub APIs.

    Enable the APIs

  8. Install Git. Git is required for copying samples to your machine.
  9. Install the Cloud Code plugin if you haven't already.
Create a function

If you've created a function before, you can download an existing function to a new workspace and edit it locally.

To create a new function using a sample, follow these steps:

  1. Click Cloud Code and then expand the Cloud Functions section.

  2. Click add Create function and select a template.

  3. Navigate to the pathway that you'd like to create your new function in, enter a name for the function, and select Create New Application.

    If the folder of your application doesn't appear automatically in the Explorer, click refresh Refresh.

    The launch.json file contains the required configurations for your function:

    {
      "configurations": [
        {
          "name": "Deploy Cloud Function",
          "type": "cloudcode.cloudfunctions",
          "request": "launch",
          "functionName": "function-hello-world",
          "gen": "GEN_2",
          "entryPoint": "helloHttp",
        }
      ]
    }
    

To learn more about creating multiple functions in a single workspace, see Manage functions in VS Code workspace.

Download an existing function to a new workspace

To download a function to a new workspace, follow these steps:

  1. Click Cloud Code and then expand the Cloud Functions section.

  2. Expand your Google Cloud project snippet, right-click the function that you wish to download, and select Download to new workspace.

  3. When prompted, enter a name for the new application and click Create New Application.

    This downloads the function to your local machine and opens it in a new workspace in your IDE.

Deploy a function

To deploy a function, follow these steps:

  1. Right-click a function and select Deploy function.

  2. In the Quickpick menu, select a Google Cloud project to deploy your function to.

  3. Select a region that the function will be deployed to.

  4. Select a runtime.

    The function's deployment may take a few minutes. While in progress, a progress_activity progress indicator appears. After it is complete, a check_circle checkmark appears. If it fails, an error error mark appears.

    If the deployment fails, refer to the Output tab for the error message. Clicking the link takes you to the build logs in Google Cloud console and provides more detail about the error.

  5. Optional: Once the function is deployed, you can perform the following actions:

Invoke a function

Invoking a function allows you to execute the deployed function in Google Cloud console from the IDE's built-in terminal. To invoke a function, follow these steps:

  1. Right-click the function and select Invoke function via HTTP.

  2. In the Trigger function via HTTP Quickpick that appears, select one of the two options:

What's next Get Support

To send feedback, report issues on

GitHub

, or ask a question on

Stack Overflow

.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["This page guides users on how to manage 2nd gen HTTP functions using Cloud Functions with Cloud Code, covering creation, downloading, deployment, and invocation."],["New functions can be created from templates within Cloud Code, allowing users to define function names and create new applications within specified pathways."],["Existing functions can be downloaded from Google Cloud to a new workspace on a local machine, allowing users to then edit locally."],["Functions are deployed to a user-specified Google Cloud project, region, and runtime, with progress indicators and options to view source code, logs, or edit metadata."],["Deployed functions can be invoked directly from the IDE via HTTP, either with default settings or by importing arguments from a JSON file."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4