Hello World Cloud Function

A simple Cloud Function that prints Hello, stdout! to the logs.

Code sample

Python

To authenticate to Cloud Run functions, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.

import functions_framework


@functions_framework.cloud_event
def hello_world(event):
    """Cloud Event Function.
    Args:
        event: Cloud event for the function trigger
    """
    print("Hello, stdout!")

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.