manigandham / serilog-sinks-googlecloudlogging

Serilog sink that writes events to Google Cloud Logging
MIT License
41 stars 25 forks source link

Service Account GCP VM #38

Closed gchampion closed 4 years ago

gchampion commented 4 years ago

If I remove the creds.json it doesn't seem to default to using the GCP VM Service account attached to the VM. Do I need a flag so that the library will use my machine service account in google cloud? I see in the instructions "no additional steps necessary" however continually get access denied (no matter the access level I grant in IAM)

manigandham commented 4 years ago

What is creds.json?

The authentication is handled by the Google-Cloud-Dotnet libraries: https://googleapis.github.io/google-cloud-dotnet/

The process is as described here: https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application

Is the environment variable pointing to a file?

gchampion commented 4 years ago

creds.json is the JSON authentication file. This all works if we use this file + environment variable. However in GCP the VM itself has a service account you can utilize (and not have a clear text auth file)

manigandham commented 4 years ago

You'll have to debug this in the Google Cloud libraries then. Try printing out that environment variable on the VM to see if might be pointing somewhere else. Is this issue happening with any other library?

gchampion commented 4 years ago

may have just been caching issue in app , seems to be working as expected now.