You installed the Google Cloud CLI on a new laptop and must list company instances with gcloud compute instances list. What must you do before running that command? (Choose as many as apply.)
Choose an answer
Tap an option to check your answer.
Correct answer: Run gcloud auth login, authenticate in the browser, and complete the login flow in the CLI..
Why this is the answer
To interact with Google Cloud resources using the gcloud CLI, you must first authenticate your identity. gcloud auth login initiates the user authentication flow, opening a browser window for you to sign in with your Google account. This process grants gcloud the necessary permissions to access resources on your behalf. Without authentication, gcloud cannot perform actions like listing instances. The other options are incorrect because: Creating a service account and downloading its key is for programmatic access, not typical user CLI interaction. There is no concept of downloading a "Cloud Identity user account key" for CLI authentication. While setting a default project (gcloud config set project) and zone (gcloud config set compute/zone) are good practices for convenience, they are not strictly required to list instances, as you could specify them directly in the command (e.g., gcloud compute instances list --project=$MYPROJECT --zone=$MYZONE). However, authentication is always mandatory.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed