Manage Cloud Run services

This page describes creating a service and viewing information about a service.

Each service has a unique and permanentrun.app URL that won't change overtime as you deploy new revisions to it. Functions deployed onCloud Run are also treated as a service and assigned arun.appaddress. The service's permanent domain consists of the service name and a hash.

Required roles

To get the permissions that you need to manage Cloud Run services and revisions, ask your administrator to grant you theCloud Run Developer (roles/run.developer) IAM role on your Cloud Run service.

For a list of IAM roles and permissions that are associated withCloud Run, seeCloud Run IAM rolesandCloud Run IAM permissions.If your Cloud Run service interfaces withGoogle Cloud APIs, such as Cloud Client Libraries, see theservice identity configuration guide.For more information about granting roles, seedeployment permissionsandmanage access.

Create a service

You create a new service by deploying a container image to it for the firsttime.Deploying a new service hasmore instructions.

View the list of services in your project

You can view a list of the available services in your project usingthe Google Cloud console or the Google Cloud CLI:

Console

To view the services list:

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Examine the displayed list of services for your project:

    services list

gcloud

To list the services in your project:

gcloud run services list

Note that each service has an associated URL.

You can filter this list by properties of the service definition, such as anassigned label.

Cloud Code

To view the services list withCloud Code,read the Cloud Run Explorer guides forIntelliJandVisual Studio Code.

Client libraries

To view the list of services from code:

REST API

To view the list of services in your project, send aGET HTTP request tothe Cloud Run Admin APIservice endpoint.

For example, usingcurl:

curl-H"Content-Type: application/json"\-H"Authorization: BearerACCESS_TOKEN"\-XGET\-d''\https://run.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/services

Replace:

  • ACCESS_TOKEN with a valid access token for an account thathas theIAM permissions to view services.For example, if you are logged into gcloud, you can retrieve anaccess token usinggcloud auth print-access-token.From within a Cloud Run container instance, you can retrievean access token using thecontainer instance metadata server.
  • REGION with the Google Cloud region of the service.
  • PROJECT-ID with the Google Cloud project ID.

View the list of functions in your project

You can view a list of the available functions in your project using theGoogle Cloud console:

Console

To filter for functions in your service list:

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Examine the displayed list of services for your project:

    services list

  3. SelectFilter services >Deployment type >Function.

    If you previously deployed your function using theCloud Functions v2 API, theDeployed by column will showCloud Functions.

Copy a service

You can make a copy of an existing service using Google Cloud console or YAML.You can change anything you want in the copy, including name and region.

Console

To copy a service:

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Select the service to copy from the displayed list of services for yourproject:

    services list

    1. ClickCopy.

    2. In the service copy page, set or change any values you want to change,such as region, etc. If you are keeping the same region, you must provide anew name for the service.

    3. ClickCreate to make a copy and deploy it using the new servicename.

YAML

  1. If you are creating a new service, skip this step.If you are updating an existing service, download itsYAML configuration:

    gcloudrunservicesdescribeSERVICE--formatexport>service.yaml
  2. Make the following configuration changes to the service.

    apiVersion:serving.knative.dev/v1kind:Servicemetadata:annotations:...name:SERVICE...spec:template:metadata:annotations:...name:REVISION
    • If you arenot deploying the copy to a different region, replaceSERVICE with the name you want to use for the copy. If you aredeploying the copy to a different region, you can use the old name.
    • ReplaceREVISION with a new revision name or delete it (if present). If you supply a new revision name, itmust meet the following criteria:
      • Starts withSERVICE-
      • Contains only lowercase letters, numbers and-
      • Does not end with a-
      • Does not exceed 63 characters
  3. Copy the service using the following command:

    gcloudrunservicesreplaceservice.yaml

    Use the--regionflag to deploy the copy to a different region.

View more details about a service

You can view more details about a service using the Google Cloud console, theGoogle Cloud CLI, YAML file, or REST API:

Console

To view a service's details:

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Click the service in the displayed list of services to open the servicedetails view.

gcloud

To view details about a service:

gcloudrunservicesdescribeSERVICE
ReplaceSERVICE with the name of the service.

You can use the--format flag to formatthe output. For example as YAML:

gcloudrunservicesdescribeSERVICE--regionREGION--formatyaml

Replace:

  • SERVICE with the name of the service.
  • REGION with the Google Cloud region of the service.

You can use--format export to export as YAML without automaticallygenerated labels or status:

gcloudrunservicesdescribeSERVICE--regionREGION--formatexport

You can also use the--format flag to getthe URL of the service:

gcloudrunservicesdescribeSERVICE--regionREGION--format='value(status.url)'

Cloud Code

To view a services details withCloud Code,read the Cloud Run Explorer guides forIntelliJandVisual Studio Code.

For more details on service revisions, seeManaging Revisions.

Client libraries

To view details about a service from code:

REST API

To view details about a service, send aGET HTTP request tothe Cloud Run Admin APIservice endpoint.

For example, usingcurl:

curl-H"Content-Type: application/json"\-H"Authorization: BearerACCESS_TOKEN"\-XGET\-d''\https://run.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/services/SERVICE-NAME

Replace:

  • ACCESS_TOKEN with a valid access token for an account thathas theIAM permissions to view service details.For example, if you are logged into gcloud, you can retrieve anaccess token usinggcloud auth print-access-token.From within a Cloud Run container instance, you can retrievean access token using thecontainer instance metadata server.
  • SERVICE-NAME with the name of the service.
  • REGION with the Google Cloud region of the service.
  • PROJECT-ID with the Google Cloud project ID.

Disable an existing service

To get the permissions that you need to disable an existing Cloud Run service and revision, ask your administrator to grant you theCloud Run Admin (roles/run.admin) IAM role on your project.

When you disable a service, any requests that are currently being processed will be allowed to complete.However, any further requests to the service URL will fail with aService unavailable orService disabled error.

Requests to service revisions that are only active due to traffic tags are not impacted because thoserevisions are not disabled.

To disable a service, you set scaling to zero. You can disable a service usingthe Google Cloud console, the Google Cloud CLI, YAML file, or API:

Console

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Click the service you want to disable to display its detailpanel, then click the pen icon next toScaling at the top rightof the detail panel.

  3. Locate theEdit scaling form and selectManual scaling.

    image

    In the field labelledNumber of instances, enter the value0 (zero).

  4. ClickSave.

gcloud

To disable a service, use the following command to set scaling to zero:

gcloudrunservicesupdateSERVICE--scaling=0

ReplaceSERVICE with the name of your service.

YAML

  1. Download your service'sYAML configuration:

    gcloudrunservicesdescribeSERVICE--formatexport>service.yaml
  2. Set themanualInstanceCount attribute to zero (0):

    apiVersion:serving.knative.dev/v1kind:Servicemetadata:name:SERVICEannotations:run.googleapis.com/scalingMode:manualrun.googleapis.com/manualInstanceCount:`0`

    ReplaceSERVICE with the name of your Cloud Run service.

  3. Create or update the service using the following command:

    gcloudrunservicesreplaceservice.yaml

REST API

To disable a service, send aPATCH HTTP request to the Cloud Run Admin APIservice endpoint.

For example, usingcurl:

curl-H"Content-Type: application/json"\-H"Authorization: BearerACCESS_TOKEN"\-XPATCH\-d'{"scaling":{"manualInstanceCount":0 }}'\https://run.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/services/SERVICE?update_mask=scaling.manualInstanceCount

Replace the following:

  • ACCESS_TOKEN: a valid access token for an account thathas theIAM permissions to update a service.For example, if you are logged intogcloud, you can retrieve anaccess token usinggcloud auth print-access-token.From within a Cloud Run container instance, you can retrievean access token using thecontainer instance metadata server.
  • SERVICE: the name of the service.
  • REGION: the Google Cloud region that the service isdeployed in.
  • PROJECT_ID: the Google Cloud project ID.

Terraform

To disable a service, set themanual_instance_count attribute to zero (0):

resource"google_cloud_run_v2_service""default"{name="SERVICE_NAME"location="REGION"template{containers{image="IMAGE_URL"}}scaling{scaling_mode="MANUAL"manual_instance_count="0"}}

Replace the following:

  • SERVICE_NAME: the name of your Cloud Run service.
  • REGION: the Google Cloud region. For example,europe-west1.
  • IMAGE_URL: a reference to the container image, forexample,us-docker.pkg.dev/cloudrun/container/hello:latest. If you use Artifact Registry,therepositoryREPO_NAME mustalready be created. The URL follows the format ofLOCATION-docker.pkg.dev/PROJECT_ID/REPO_NAME/PATH:TAG

Delete existing services

The following considerations apply to deleting a service:

  • Deleting a service deletes all resources related to this service, including allrevisions of this service whether they are serving traffic or not.
  • Deleting a service does not automatically remove container images from Artifact Registry.To delete container images used by the deleted revisions from Artifact Registry,refer toDeleting images.
  • Deleting a service with one or more Eventarc triggers does not automaticallydelete these triggers. To delete the triggers refer toManage triggers.
  • After deletion, the service remains visible in the Google Cloud console and in the command line interfaceuntil the deletion is fully complete. However, you cannot update the service.
  • Deleting a service is permanent: there is no undo or restore.However, if after deleting a service, you deploy a new service with the samename in the same region, it will have the same endpoint URL.
  • When you delete a Cloud Run function, it stops accepting new requests.However, Cloud Run doesn't immediately terminate any running instances.Instead, the function runs until task completion within your configured timeout.This might cause the function to appear active in logs for a short period after youdelete it.

You can delete a service or a function using the Google Cloud console, theGoogle Cloud CLI, YAML file, or REST API:

Console

To delete a service:

  1. In the Google Cloud console, go to the Cloud RunServices page:

    Go to Cloud Run

  2. Locate the service you want to delete in the services list, and clickits checkbox to select it.

  3. ClickDELETE. This deletes all revisions of the service.

gcloud

To delete a service, use the command:

gcloud run services deleteSERVICE --regionREGION

Replace

  • SERVICE with the name of your service.
  • REGION with the Google Cloud region of the service.

Client libraries

To delete a service from code:

REST API

To delete a service, send aDELETE HTTP request tothe Cloud Run Admin APIservice endpoint.

For example, usingcurl:

curl-H"Content-Type: application/json"\-H"Authorization: BearerACCESS_TOKEN"\-XDELETE\-d''\https://run.googleapis.com/v2/projects/PROJECT_ID/locations/REGION/services/SERVICE-NAME

Replace:

  • ACCESS_TOKEN with a valid access token for an account thathas theIAM permissions to delete a service.For example, if you are logged into gcloud, you can retrieve anaccess token usinggcloud auth print-access-token.From within a Cloud Run container instance, you can retrievean access token using thecontainer instance metadata server.
  • SERVICE-NAME with the name of the service.
  • REGION with the Google Cloud region of the service.
  • PROJECT-ID with the Google Cloud project ID.

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

Last updated 2026-02-19 UTC.