Preparing Practice Exam…
Please wait a moment while the system generates the exam questions, answers, and study session.
Please wait a moment while the system generates the exam questions, answers, and study session.
Question 19 of 98
Free Preview · 98 of 324 · questions 1–98 of 324 are free. Sign up free to sync your progress across devices.
Select one answer.
Written by other learners. Comments can disagree with the marked answer — check the official documentation when in doubt.
While A doesn't really work, given that the VM is already created, all the other answers are absolutely unacceptable. You should never store private keys as raw text, such as .json.
The correct way to assign a specific service account to a VM is by specifying it during VM creation in the 'Identity and API Access' section. This ensures the VM uses the specified service account for authentication when accessing Google Cloud services. The other options, which involve manually downloading and managing JSON keys, are not recommended due to security risks and Google's best practices for managing service accounts.
seems like A. doesn't fit. As it's ONLY valid only during the VM creation process. It allows you to assign a custom service account instead of the default one. However, if the VM is already created, you cannot use this method. C. correct answer gcloud compute instances stop VM_NAME --zone ZONE gcloud compute instances set-service-account VM_NAME \ --zone ZONE \ --service-account SERVICE_ACCOUNT_EMAIL gcloud compute instances start VM_NAME --zone ZONE