Allow google cloud compute to access firestore

I have setup a small vm on google cloud compute. I want it to be able to access my firestore database, but I cannot make it work. I tried using the firebase-admin lib in the vm, but it is making a permission denied error. My firestore rules fine. Do you know how to do?

Thanks!


I created this community wiki from the comment of the OP, as mentioned the solution was found on the next post.

It was required enable Cloud API access scope for the services on Google Cloud Console for VM instance details

It's required to stop the instance in order to change API scope as mentioned in the documentation