Google Cloud Professional Cloud Developer — Question 174

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?

Answer options

Correct answer: A

Explanation

Option A is the correct answer because querying the metadata server is the most efficient way to securely access the application project ID and region. The other options involve either manual processes or additional overhead that make them less performant compared to direct access to the metadata server.