To access your Datastore mode database from an external application running on a platform outside of Google Cloud Platform:
-
Go to the Create Service Account Key page in Google Cloud Platform Console.
-
Click the drop-down box below Service account, then click New service account.
-
Enter a name for the service account in Service account name.
-
Under the Role dropdown, select an IAM role that grants access to your database such as Cloud Datastore Owner.
-
Use the default Service account ID or generate a different one.
-
Select JSON in Key type.
-
Click Create.
-
Upon successful creation, your browser will download the private key. The GCP Console provides a prompt that displays the private key file name. Note the file name so you can locate it, then click Close to dismiss the prompt.
-
Your Service Account is the Email address displayed under the Service Account section.
-
Your Private Key is the file you just downloaded.
Use this service account to configure credentials for your application code as described in Providing service account credentials.
For more info refer to : https://cloud.google.com/datastore/docs/activate#other-platforms