Easy1 markMultiple Choice

GCP ACE · Question 25 · Domain 3.3: Deploying and implementing Cloud Run and Cloud Functions

You have a container image stored in Artifact Registry at us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest. You want to deploy this image to Cloud Run so that it can receive HTTPS requests from the public internet.

Which gcloud command should you use?

Answer options:

A.

gcloud compute instances create-with-container --container-image us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest

B.

gcloud run deploy --image us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest --allow-unauthenticated

C.

gcloud functions deploy --source us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest

D.

gcloud app deploy us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest

How to approach this question

Identify the command group for Cloud Run and the flag required to make it public.

Full Answer

B.gcloud run deploy --image us-central1-docker.pkg.dev/my-project/my-repo/my-app:latest --allow-unauthenticated✓ Correct
The `gcloud run deploy` command is used to deploy container images to Cloud Run. Because the requirement states it must receive requests from the public internet, you must include the `--allow-unauthenticated` flag, which grants the `roles/run.invoker` role to `allUsers`.

Common mistakes

Forgetting the `--allow-unauthenticated` flag, which would result in the service returning a 403 Forbidden error to public users.

Practice the full GCP Associate Cloud Engineer Practice Exam 7

50 questions · hints · full answers · grading

More questions from this exam