Thursday, August 24, 2017

Google Cloud Web API c#

1. Create Project  > Google Cloud ASP.NET Core Web API C#
2. Choose Google Project ID (can link with FireBase)

If you want run locally you need to add credential


3. Create  json file,
4. Copy this .json file to locally (outside cannot browse)


public Startup(IHostingEnvironment env)
{
      //Here is the Code for Credential
    string credential_path = "CargoTracking-2e89f93ec38b.json";
    Environment.SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", credential_path);

------------------------

[GCP Command]
gcloud config list
gcloud auth login
gcloud config set project [myproject]

No comments:

Post a Comment