exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 199 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 199
Topic #: 1
[All Professional Cloud Developer Questions]

You are using Cloud Run to host a web application. You need to securely obtain the application project ID and region where the application is running and display this information to users. You want to use the most performant approach. What should you do?

  • A. Use HTTP requests to query the available metadata server at the http://metadata.google.internal/ endpoint with the Metadata-Flavor: Google header.
  • B. In the Google Cloud console, navigate to the Project Dashboard and gather configuration details. Navigate to the Cloud Run “Variables & Secrets” tab, and add the desired environment variables in Key:Value format.
  • C. In the Google Cloud console, navigate to the Project Dashboard and gather configuration details. Write the application configuration information to Cloud Run's in-memory container filesystem.
  • D. Make an API call to the Cloud Asset Inventory API from the application and format the request to include instance metadata.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
alpha_canary
2 months, 2 weeks ago
Selected Answer: A
https://cloud.google.com/run/docs/container-contract#metadata-server:~:text=Project%20ID%20of%20the%20project%20the%20Cloud%20Run%20service%20or%20job%20belongs%20to
upvoted 1 times
...
alpha_canary
2 months, 2 weeks ago
https://cloud.google.com/run/docs/container-contract#metadata-server:~:text=Project%20ID%20of%20the%20project%20the%20Cloud%20Run%20service%20or%20job%20belongs%20to
upvoted 1 times
...
__rajan__
9 months, 1 week ago
Selected Answer: A
A is correct.
upvoted 1 times
...
telp
1 year, 5 months ago
Selected Answer: A
Answer A https://cloud.google.com/run/docs/container-contract#metadata-server
upvoted 2 times
...
TNT87
1 year, 6 months ago
Selected Answer: A
https://cloud.google.com/run/docs/container-contract#metadata-server Answer A
upvoted 1 times
...
micoams
1 year, 6 months ago
Selected Answer: A
Definitely A, it's clear in the docs. https://cloud.google.com/run/docs/container-contract#metadata-server
upvoted 2 times
...
sharath25
1 year, 6 months ago
Selected Answer: A
option A
upvoted 1 times
...
zellck
1 year, 6 months ago
Selected Answer: A
A is the answer. https://cloud.google.com/run/docs/container-contract#metadata-server Cloud Run container instances expose a metadata server that you can use to retrieve details about your container instance, such as the project ID, region, instance ID or service accounts. You can access this data from the metadata server using simple HTTP requests to the http://metadata.google.internal/ endpoint with the Metadata-Flavor: Google header: no client libraries are required.
upvoted 1 times
...
melisargh
1 year, 6 months ago
Selected Answer: B
voting B because is not A since thats compute metadata, if you can access you can query project id but not the region necessarily from cloud run but gce is not D since you cannot query project id C is too manual and static so by discard I guess is B
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago