Learn how to set up and deploy a sample Hello World application to
Cloud Run and view the status of your live service's resources.

## Before you begin

## Create an application

1. [Launch the Cloud Shell Editor](https://ide.cloud.google.com).
2. From the Cloud Code status bar, select **New Application**.
3. Choose **Cloud Run application** as your preferred application type.
4. From the list of sample applications, choose a Hello World app. For example, choosing `Python (Flask): Hello World` creates a starter Python (Flask) Hello World app.
5. Select a folder as your application location and then click **Create New Application**. Cloud Shell Editor loads the application in a new workspace. After the workspace loads, your app is accessible in the explorer view.

## Deploy to Cloud Run

To deploy your application to Cloud Run:

1. Choose the **Deploy to Cloud Run** command using the command palette (accessible with `Ctrl`/`Cmd`+`Shift`+`P`). This brings up the Cloud Run Deploy UI.
2. If prompted, authorize Cloud Code to make Google Cloud API calls.
3. Set your Google Cloud project.
4. If prompted, enable the Cloud Run API by clicking **Enable APIs**.
5. In the Deploy to Cloud Run dialog, select a pre-existing service or create a new one.
6. If you're creating a new service, choose **Cloud Run (fully managed)** under Deployment Platform.
7. Choose a region to deploy to.
8. For Authentication, select **Allow unauthenticated invocations** to make this a public service.
9. After you define your preferred settings, click **Deploy**. Cloud Code builds your image, pushes it to the registry, and deploys your app to Cloud Run. Your service is now live.
10. View your running service by following the URL displayed in your Cloud Run: Deploy dialog.

## Edit your service

To edit your application:

1. With the Explorer view, find the `app.py` file that implements the service behavior.
2. Change the message "It's running!" to a message of your choosing.
3. After you make this change, choose the **Deploy to Cloud Run** command using the command palette.
4. Check that the service you created is selected in Service Settings.
5. Click **Deploy**.
6. After your application finishes building and deploying, you can refresh your service to see your updated message.

## View logs

You can also view logs from your deployed application with the Log Viewer
that comes with Cloud Code.

To view logs:

1. To open the Cloud Run Explorer, click ![](https://docs.cloud.google.com/static/code/docs/vscode/images/cloudcode-icon.png) **Cloud Code** and then expand the **Cloud Run** section.
2. Right-click your Cloud Run service and then click **View logs**.
3. Refresh your app in the browser, and see the new logs generated by clicking the Logs refresh button.

## Clean up


To avoid incurring charges to your Google Cloud account for
the resources used on this page, follow these steps:

> [!CAUTION]
> **Caution** : Deleting a project has the following effects:
>
> - **Everything in the project is deleted.** If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
> - **Custom project IDs are lost.** When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.
>
>
> If you plan to explore multiple architectures, tutorials, or quickstarts, reusing projects
> can help you avoid exceeding project quota limits.

1. In the Google Cloud console, go to the **Manage resources** page.

   [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)
2. In the project list, select the project that you want to delete, and then click **Delete**.
3. In the dialog, type the project ID, and then click **Shut down** to delete the project.

If you're using a pre-existing project and want to delete the resources you created for this
quickstart:

- **Container image:** While Cloud Run doesn't charge when a service isn't in use, you might still be [charged for storing the container image in Artifact Registry](https://docs.cloud.google.com/artifact-registry/pricing). To delete your image, open the Artifact Registry page, select the repository that contains your image, select your image, click **Delete** , and then click **Delete** .   

  [Open the Artifact Registry page](https://console.cloud.google.com/artifacts)
- **Cloud Run service:** To delete a Cloud Run service, from the Cloud Run page in the Google Cloud console, select the service you'd like to delete, click **Delete** , and then click **Delete** .

  <br />

  [Open the Cloud Run page](https://console.cloud.google.com/run)

## What's next

- Discover the features that the [Cloud Shell Editor interface](https://docs.cloud.google.com/shell/docs/editor-overview) offers.
- Learn how to [configure Cloud Shell](https://docs.cloud.google.com/shell/docs/configuring-cloud-shell) to customize your experience.