Spring Cloud GCP Datastore host setting not working

  Kiến thức lập trình

I changed my GCP datastore settings in Spring Boot from

spring:
  cloud:
    gcp:
      project-id: project
      datastore:
        project-id: service-project

to

spring:
  cloud:
    gcp:
      project-id: project
      datastore:
        project-id: service-project
        host: https://eur3-datastore.googleapis.com:443

and now when I startup the application it always throws the following error:
com.google.cloud.datastore.DatastoreException: Unauthenticated.

I’m using the following versions:

-> spring boot 3.2.4

-> cloud dependencies 2023.0.0

-> cloud gcp dependencies 5.1.2

It’s also worth noting that I tried doing a POST request to https://eur3-datastore.googleapis.com/v1/projects/service-project:runQuery through postman and succeeded.
So why is Spring Boot failing to autoconfigure the connection when I provide the host setting?

New contributor

Artemis is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT