Reputation: 41
I have a simple spring boot microservice (gradle) that I want to deploy on cloud run and use cloud Firestore for storing some data. I configured it locally, so I can read and write data to firestore. If I create and run a docker image of the application locally, it works. When I deploy it on cloud run, the application starts normally,
except when it tries to read data from firestore (when I call an endpoint), I get the following exception in postman:
java.util.concurrent.ExecutionException: com.google.api.gax.rpc.PermissionDeniedException: io.grpc.StatusRuntimeException: PERMISSION_DENIED: Missing or insufficient permissions.
On cloud, docker image is created with cloud build, through my github repo.
What should I do to make it work on cloud run?
Upvotes: 2
Views: 1591
Reputation: 41
I found the problem.
I followed instructions from this documentation and here it is used this library:
compile 'com.google.cloud:google-cloud-firestore:1.32.0'
Then I tried with this library (this is documentation) and everything worked!
implementation 'com.google.firebase:firebase-admin:8.1.0'
Upvotes: 2