Google Professional Cloud Developer Question 336
Select 3Google Cloud PlatformYou are deploying a Python-based application to Google Cloud Functions. The application processes uploaded images and stores metadata in a Cloud Firestore database. Which of the following considerations are essential for successfully deploying and running the application?
- A
Ensure that the runtime environment selected for the Cloud Function matches the Python version specified in the application.
- B
Assign a service account with the appropriate permissions to access Cloud Firestore.
- C
Manually configure horizontal scaling for the function to handle increased workload.
- D
Include all necessary third-party libraries in a requirements.txt file.
- E
Use a VM instance to monitor the function's logs in real time.
Show answer and explanation
Correct answers: A, B, D
Explanation
When deploying a Python-based application to Google Cloud Functions, it is critical to ensure compatibility between the runtime version and the application, provide the appropriate permissions using a service account, and include all required dependencies in the deployment package. These steps ensure the function runs smoothly and interacts correctly with other Google Cloud services such as Cloud Firestore. Manual scaling and external monitoring using a VM are not required, as Cloud Functions handles scaling automatically and offers built-in logging tools.
- A. Correct.
Correct: The runtime environment must match the Python version used in the application to ensure compatibility and prevent runtime errors.
- B. Correct.
Correct: The service account assigned to the Cloud Function must have the necessary permissions to access Cloud Firestore for writing and retrieving metadata.
- C. Incorrect.
Incorrect: Google Cloud Functions automatically scales based on the workload, so manual configuration of scaling is not necessary.
- D. Correct.
Correct: Including a requirements.txt file ensures that all third-party libraries required by the application are installed in the Cloud Function's environment.
- E. Incorrect.
Incorrect: Cloud Functions logs can be monitored directly in Google Cloud Console using Cloud Logging, so using a VM instance for this purpose is unnecessary.