Cloud Run sends a SIGTERM signal to your container instance before the container instance terminates, due to an event like scale down or deleted revision. By handling this signal, you can now gracefully terminate your applications and do some cleanup tasks–as opposed to an abrupt shutdown of the container.
Code sample
Go
To authenticate to Cloud Run, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Java
To authenticate to Cloud Run, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Node.js
To authenticate to Cloud Run, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Python
To authenticate to Cloud Run, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
What's next
To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.