Wann sollte ich eine Funktion in Cloud Run bereitstellen?
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Cloud Run bietet entscheidende Vorteile: Sie müssen weder Server verwalten oder Software konfigurieren noch Frameworks aktualisieren oder Betriebssysteme patchen. Software und Infrastruktur werden vollständig von Google verwaltet, sodass Sie nur Code hinzufügen müssen.
Außerdem werden Ressourcen automatisch als Reaktion auf Anfragen oder Ereignisse bereitgestellt.
Das bedeutet, dass ein Cloud Run-Dienst automatisch von wenigen Aufrufen pro Tag auf viele Millionen Aufrufe skaliert wird, ohne dass Sie etwas tun müssen.
Wenn Sie eine Funktion, einen Quellcode oder ein Container-Image in Cloud Run bereitstellen, erhalten Sie alle im Containerlaufzeitvertrag beschriebenen Vorteile.
Anwendungsfälle für die Bereitstellung von Funktionen
Sie können eine an Ereignisse gebundene Funktion direkt bereitstellen, um asynchrone Arbeitslasten (z. B. einfache ETL-Vorgänge) oder Cloud-Automatisierungen (z. B. das Auslösen von Anwendungs-Builds) zu implementieren.
Außerdem sind Funktionen aufgrund der automatischen Bereitstellung eines HTTPS-Endpunkts ideal für Webhooks geeignet.
Weitere häufige Anwendungsfälle für die Bereitstellung einer Funktion in Cloud Run finden Sie in der folgenden Tabelle:
Anwendungsfall
Beschreibung
Streamingdatenverarbeitung/ETL
Wenn Cloud Storage-Ereignisse wie das Erstellen, Ändern oder Entfernen einer Datei eintreten, können Sie darauf reagieren. Mit Cloud Run lassen sich Bilder verarbeiten, Videos transcodieren, Dateien validieren und transformieren sowie beliebige Onlinedienste aufrufen.
Webhooks
Mit einem HTTP-Trigger reagieren Sie auf Ereignisse, die von Drittanbietersystemen wie GitHub, Slack, Stripe oder anderen Quellen, die HTTP-Anfragen senden, ausgelöst werden.
Mobiles Back-End
Mit Firebase, der mobilen Google-Plattform für App-Entwickler, können Sie Ihr mobiles Back-End in Cloud Run-Funktionen schreiben. Prüfen Sie auf Ereignisse aus Firebase Analytics, Realtime Database, Authentication und Storage und reagieren Sie darauf.
IoT
Stellen Sie sich vor, wie Zehn- oder Hunderttausende von Geräten Daten in Cloud Pub/Sub streamen und damit Cloud Run-Funktionen zum Verarbeiten, Transformieren und Speichern von Daten starten. Mit Cloud Run ist dies komplett serverlos möglich.
Cloud Run-Funktionen bietet eine logische Verbindungsschicht, die es Ihnen ermöglicht, Code zum Verbinden und Erweitern von Clouddiensten zu schreiben. Sie können überwachen, ob eine Datei in Cloud Storage hochgeladen wird, es Änderungen an einem Log gibt oder eine Nachricht zu einem Pub/Sub-Thema eingeht, und auf solche Ereignisse reagieren. Cloud Run-Funktionen ergänzen vorhandene Clouddienste und ermöglichen Ihnen, für eine größere Zahl von Anwendungsfällen mit beliebiger Programmierlogik gewappnet zu sein.
Cloud Run-Funktionen haben Zugriff auf die Anmeldedaten des Google-Dienstkontos und sind somit nahtlos mit den meisten Google Cloud-Diensten authentifiziert, einschließlich Cloud Vision und vielen anderen. Darüber hinaus werden Cloud Run-Funktionen von vielen Cloud-Clientbibliotheken unterstützt, die diese Integrationen weiter vereinfachen.
[[["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-03 (UTC)."],[],[],null,["# When should I deploy a function to Cloud Run?\n\n| **Note:** Cloud Functions has been renamed to Cloud Run functions. For more information, see the [Cloud Run functions blog post](https://cloud.google.com/blog/products/serverless/google-cloud-functions-is-now-cloud-run-functions).\n\nCloud Run removes the work of managing servers, configuring\nsoftware, updating frameworks, and patching operating systems. The software and\ninfrastructure are fully managed by Google so that you just add code.\nFurthermore, provisioning of resources happens automatically in response to\nrequests or events.\nThis means that a Cloud Run service automatically scales out from a few\ninvocations a day to many millions of invocations without any work from you.\nYou can optionally use [manual scaling](/run/docs/configuring/services/manual-scaling)\nif you need more control over your scaling behavior.\n\nWhen you deploy a function, source code or a container image to\nCloud Run, you receive all of the benefits described in the\n[Container runtime contract](/run/docs/container-contract).\n\nUse cases for deploying functions\n---------------------------------\n\nYou can directly deploy a function bound to events in order to implement\nasynchronous workloads (such as lightweight [ETL](/learn/what-is-etl)) or cloud\nautomations (such as triggering application builds).\nIn addition, the automatic provisioning of an HTTPS endpoint makes functions a\nperfect candidate for webhooks.\n\nSee the following table for additional common use cases for deploying a function\nto Cloud Run:\n\nConnect and extend cloud services\n---------------------------------\n\nCloud Run functions provides a connective layer of logic that lets you write\ncode to connect and extend cloud services. Listen and respond to a file upload\nto Cloud Storage, a log change, or an incoming message on a Pub/Sub\ntopic. Cloud Run functions augments existing cloud services and lets you\naddress an increasing number of use cases with arbitrary programming logic.\nCloud Run functions have access to the Google Service Account credential and\nare thus seamlessly authenticated with the majority of Google Cloud services,\nincluding Cloud Vision, as well as many others. In addition,\nCloud Run functions are supported by numerous\n[Cloud Client Libraries](/apis/docs/cloud-client-libraries), which\nfurther simplify these integrations.\n\nWhat's next\n-----------\n\n- Try the [getting started guide for deploying a function](/run/docs/quickstarts/functions/deploy-functions-console).\n- If you have existing functions and need to use the `gcloud functions deploy` command, the Cloud Functions v2 API, or the `google_cloudfunctions2_function` Terraform configuration for backward compatibility, you can [deploy functions with the `gcloud functions` command](/functions/docs/deploy)."]]