Compare / Cloud Run functions vs Cloud Run services

Cloud Run functions vs Cloud Run services

Both are serverless and scale to zero. Cloud Run functions (formerly Cloud Functions) run a single function in response to an event or HTTP request. A current Cloud Run function is deployed as a Cloud Run service. Services also accept source deployments or custom containers for applications with multiple routes and custom dependencies.

In 22 practice questions across 8 practice banks

Associate Cloud Engineer Original practice scenario

You already have a containerized HTTP API with several routes and custom system libraries. You want a serverless deployment without adapting the API to a single Functions Framework handler. Which deployment fits?

  1. Functions use the Functions Framework handler model in supported runtimes. They are useful for focused HTTP or event handlers, but are not the direct deployment path for this existing custom container.

  2. A Cloud Run service can run the existing containerized API, provided the image satisfies the Cloud Run container runtime contract.

Pick an answer to see why each option is right or wrong.

Try 20 questions free

At a glance

Cloud Run functionsCloud Run services
Unit of deploymentFunction source built into a Cloud Run serviceSource code or a container image that meets the runtime contract
TriggersHTTP and events (Pub/Sub, Cloud Storage, Eventarc)HTTP, gRPC, WebSockets; events through Eventarc
Runtime controlSupported language runtimesCustom runtime and system libraries; must satisfy the Cloud Run container contract
Typical useGlue code, lightweight event handlersAPIs, web apps and services with several endpoints

Choose Cloud Run functions when

  • A small piece of code should react to an event such as a file upload or a message.
  • You want the Functions Framework handler model in a supported runtime.
  • The logic is a single, short-lived handler.

Choose Cloud Run services when

  • You already have a container or need custom system dependencies.
  • The service exposes several routes or requires a custom container; current functions also support concurrency.
  • You want the same container to run elsewhere.

Exam tip

Event-driven handlers point to functions; custom containers or multiple endpoints point to services. Check the generation in older questions: Cloud Run functions (1st gen) has different capabilities from current Cloud Run functions. Do not assume all functions lack concurrency or require a separate platform.

Official documentation