I'm trying to set up a very simple test application for connecting to my Firebase Cloud Firestore instance.
It's a C# .NET Core console application using .NET Core 3.0 on Windows 7
I'm just trying to connecting to my Firestore instance using my project name.
My GOOGLE_APPLICATION_CREDENTIALS
environment variable is set to C:\test\creds.json
which I created from using the "Create Key" feature on the GCP Console page for my default service account.
When I run the code below, I get the following error:
using Google.Cloud.Firestore;
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
FirestoreDb db = FirestoreDb.Create("my-proj-id");
}
}
}
Exception:
The Application Default Credentials are not available. They are available if running in Google Compute Engine. Otherwise, the environment variable GOOGLE_APPLICATION_CREDENTIALS must be defined pointing to a file defining the credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information.'
When I run ProcessMonitor to detect file system activity, my application never even tries to touch the creds.json
file, which makes me believe the C# Cloud Firestore API isn't even finding my creds file. I've set the GOOGLE_APPLICATION_CREDENTIALS
env variable at both the user and system level.
Is there a problem with how I've configured things?