Google ACE Deploying and Implementing a Cloud Solution Practice Question
Which gcloud command is used to deploy a Cloud Function triggered by HTTP requests?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud functions deploy my-function --runtime python39 --trigger-http
The command 'gcloud functions deploy' with --trigger-http creates an HTTP-triggered function. --runtime specifies the language runtime. --trigger-topic is for Pub/Sub triggers.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gcloud functions call my-function --data '{"key":"value"}'
Why it's wrong here
Running `gcloud functions call` sends a test invocation payload to an already-deployed Cloud Function; it performs no deployment actions. The `--data` flag supplies the event data for that invocation, not deployment configuration. To deploy a function, you need `gcloud functions deploy` with a runtime, trigger, and source.
- ✗
gcloud run deploy my-function --source . --platform managed
Why it's wrong here
This command deploys a container image to Cloud Run, which is Google's managed platform for containerized applications, not Cloud Functions. Cloud Functions are source-based and require a runtime (like python39) and a trigger flag; Cloud Run uses Docker containers and the `--platform managed` flag to select the fully managed service. Even if the function logic is identical, the deployment target and command syntax differ.
- ✓
gcloud functions deploy my-function --runtime python39 --trigger-http
Why this is correct
This command correctly deploys an HTTP-triggered Cloud Function: `gcloud functions deploy` creates or updates a function resource, `--runtime python39` selects the Python 3.9 execution environment, and `--trigger-http` configures an HTTPS endpoint that invokes the function on web requests. No other trigger type is needed. The command will return a URL for the deployed function.
- ✗
gcloud functions deploy my-function --runtime python39 --trigger-topic my-topic
Why it's wrong here
This command deploys a Cloud Function, but it uses `--trigger-topic my-topic` to subscribe the function to messages published on a Pub/Sub topic. It will not create an HTTP endpoint; instead, messages on the topic trigger the function asynchronously. Since the question asks for an HTTP trigger, this option is incorrect.
Go deeper
Related to this question
About these practice questions
This ACE question is part of Courseiva's 769-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.