How to Deploy an application to App Engine in GCP

app engine gcp
Reading Time: 3 minutes

Hello Readers! In this we will see how easily we can deploy an application to App Engine in GCP. In this blog firstly we will create a simple app engine application using cloud shell local environment. Then I will deploy that application to the App Engine. So, before starting firstly we will see what is an App Engine?

Basically, App Engine is a PaaS (Platform as a service) which provides the infrastructure in which your application runs. In this you don’t have to focus on the infrastructure. All you need is to focus on your code, that is what App Engine is for.

Let’s get started playing with App Engine!

Firstly activate your GCP cloud shell.

gcp

 Here I will clone a simple app engine application from github.

$ git clone https://github.com/GoogleCloudPlatform/appengine-guestbook-python
app

Now, I have the source code of the application. Let’s go into the tree in which it is stored.

$ cd appengine-guestbook-python

The file app.yaml, specifies the configuration of the application. It also specifies the runtime for this application. Here handlers are the urls on which it responds.

$ cat app.yaml
app

Let’s run the application locally in the cloud shell using the built-in app engine development environment.

$ dev_appserver.py ./app.yaml
img

Now, the application is running locally. So, I will use the cloud shell’s built-in previewing capability to preview it.

Here is my application. So, the application is running locally in a cloud shell.

img

Therefore, we are ready to deploy our application to the app-engine service.

$ gcloud app deploy ./index.yaml ./app.yaml
myimg

We are asked to confirm it. Do that.

App Engine files are stored in google cloud storage.

cli

It will take a minute for this process.

console

It’s done! 

console

Now, let’s go back to the App Engine dashboard. You will find here the link for our application which we have deployed.

app

Click here on this link you will find the deployed version of the application.

When we are done with this application we can disable it using the App Engine console. For this, scroll down to settings. And Click Disable Application.

app

Here it will ask for an Application ID. Confirm this and click Disable.

So, the application has been disabled. Everything is done now.

Conclusion

In this blog we have seen how easily we can deploy any application to the App Engine in GCP. Thank you for sticking to the end. Therefore If you like this blog, please do show your appreciation by giving thumbs ups and share this blog and give me suggestions on how I can improve my future posts to suit your needs. 

HAPPY LEARNING!

Written by 

Naincy Kumari is a DevOps Consultant at Knoldus Inc. She is always ready to learn new technologies and tools. She loves painting and dancing.

2 thoughts on “How to Deploy an application to App Engine in GCP5 min read

  1. Pingback: - Knoldus Blogs

Comments are closed.