ASSOCIATE-CLOUD-ENGINEER practice question 9 of 35

You deployed an App Engine application using gcloud app deploy, but it did not deploy to the intended project. You want to find out why this happened and where the application deployed. What should you do?

Full set: 332 questions
Answer options
A: Check the app.yaml file for your application and check project settings.
B: Check the web-application.xml file for your application and check project settings.
C: Go to Deployment Manager and review settings for deployment of applications.
D: Go to Cloud Shell and run gcloud config list to review the Google Cloud configuration used for deployment. Correct answer
Correct Answer:
D. Go to Cloud Shell and run gcloud config list to review the Google Cloud configuration used for deployment.
Explanation

The gcloud command-line tool operates based on a set of configurations that define default properties like project, region, and zone. When you execute a command such as gcloud app deploy without explicitly specifying the --project flag, the tool uses the project ID set in the currently active configuration. The command gcloud config list displays all properties for the active configuration, including the core/project property. By running this command, you can immediately identify which project was targeted by the deployment, thus explaining both why it went to an unintended project and where it was deployed.

Why Incorrect

A. The app.yaml file defines the application's runtime, scaling, and handler settings, but it does not specify the target Google Cloud project for deployment.
B. The web-application.xml (or web.xml) file is a standard configuration file for Java web applications and does not contain Google Cloud project deployment information.
C. Google Cloud Deployment Manager is an infrastructure-as-code service for provisioning resources, not for deploying application code via the gcloud app deploy command.

References

1. gcloud config list: "The gcloud config list command displays all the properties for the currently active configuration." This includes the core.project property

which is used by default for commands.

Source: Google Cloud SDK Documentation

gcloud config list

https://cloud.google.com/sdk/gcloud/reference/config/list

2. gcloud app deploy: The documentation for this command shows the optional --project flag. It states

"The Google Cloud project ID to use for this invocation. If omitted

then the current project is assumed." The "current project" is determined by the gcloud configuration.

Source: Google Cloud SDK Documentation

gcloud app deploy

https://cloud.google.com/sdk/gcloud/reference/app/deploy

3. app.yaml Configuration File: The official reference for the app.yaml file for both Standard and Flexible environments lists all valid configuration elements. A project or projectid field is not among them

confirming that the project is not defined within the application's configuration file.

Source: Google Cloud App Engine Documentation

app.yaml reference

https://cloud.google.com/appengine/docs/standard/reference/app-yaml

4. Initializing the gcloud CLI: "When you initialize the gcloud CLI

you run the gcloud init command. The gcloud init command creates a named configuration called default and sets it as the active configuration. The default configuration contains your user account and a default Google Cloud project." This establishes the concept of a default project within a configuration.

Source: Google Cloud SDK Documentation

"Initializing the gcloud CLI"

https://cloud.google.com/sdk/docs/initializing (Section: "Default project

region

and zone")

Scroll to Top