
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Deploy the Hello World application to App Engine
/ 10
In this lab, you create and deploy a simple App Engine application using a virtual environment in the Google Cloud Shell.
In this lab, you learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
Google Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud.
Google Cloud Shell provides command-line access to your Google Cloud resources.
In Cloud console, on the top right toolbar, click the Open Cloud Shell button.
Click Continue.
It takes a few moments to provision and connect to the environment. When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. For example:
gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Example output:
Output:
Example output:
Initialize your App Engine app with your project and choose its region:
Clone the source code repository for a sample application in the hello_world directory:
Navigate to the source directory:
In this task, you run the Hello World application in a local, virtual environment in Cloud Shell.
Ensure that you are at the Cloud Shell command prompt.
Create a Dockerfile
Edit the Dockerfile [hint: nano Dockerfile] to contain the following content.
Build a container image to run a Python virtual environment.
Run the application:
In Cloud Shell, click Web preview () > Preview on port 8080 to preview the application.
Result:
To end the test, return to Cloud Shell and press Ctrl+C to abort the deployed service.
Using the Cloud Console, verify that the app is not deployed. In the Cloud Console, on the Navigation menu (), click App Engine > Dashboard.
To deploy your application to the App Engine Standard environment:
Navigate to the source directory:
Deploy your Hello World application.
Y
and then Enter
.This app deploy command uses the app.yaml file to identify project configuration.
gcloud app deploy
command.Launch your browser to view the app at http://YOUR_PROJECT_ID.appspot.com
Copy and paste the URL into a new browser window.
Result:
Congratulations! You created your first application using App Engine.
Click Check my progress to verify the objective.
App Engine offers no option to Undeploy an application. After an application is deployed, it remains deployed, although you could instead replace the application with a simple page that says something like "not in service."
However, you can disable the application, which causes it to no longer be accessible to users.
In the Cloud Console, on the Navigation menu (), click App Engine > Settings.
Click Disable application.
Read the dialog message. Enter the App ID and click DISABLE.
If you refresh the browser window you used to view the application site, you'll get a 404 error.
You created your first application using App Engine!
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one