As authentication for the Spanner Entity Framework Core provider, the service account JSON
credentials file location should be provided in the
GOOGLE_APPLICATION_CREDENTIALS environment variable. Otherwise, the provider
can also use the default credentials set in the Google Cloud CLI gcloud
application.
Use the Spanner Entity Framework Core provider
For more information about the available features, limitations of the provider,
recommendations on how to use the provider, and for code samples, consult
the reference documentation on
GitHub.
What's next
Checkout the code examples on how to use the
Spanner Entity Framework Core provider.
View the repository for the Spanner Entity Framework Core
provider on GitHub.
File a GitHub issue to report a bug or ask a
question about the Spanner Entity Framework provider.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Using Entity Framework Core with Spanner\n\n| **PostgreSQL interface note:** The Spanner Entity Framework Core provider isn't supported in PostgreSQL databases.\n\n\u003cbr /\u003e\n\nThe [Spanner Entity Framework Core provider](https://github.com/googleapis/dotnet-spanner-entity-framework) lets you\ncreate a Spanner database, run queries, and update data through an\napplication using [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/). The\nprovider is compatible with\n[Microsoft.EntityFrameworkCore 8](https://www.nuget.org/packages/Microsoft.EntityFrameworkCore/8.0).\n\nSet up the Spanner Entity Framework Core provider\n-------------------------------------------------\n\nTo set up the Spanner Entity Framework Core provider in your application, add the following\ndependency. \n\n \u003cProject Sdk=\"Microsoft.NET.Sdk\"\u003e\n\n \u003cPropertyGroup\u003e\n \u003cTargetFramework\u003enet8.0\u003c/TargetFramework\u003e\n \u003cOutputType\u003eExe\u003c/OutputType\u003e\n \u003c/PropertyGroup\u003e\n\n ...\n\n \u003cItemGroup\u003e\n \u003cPackageReference Include=\"Google.Cloud.EntityFrameworkCore.Spanner\" Version=\"3.2.0\" /\u003e\n \u003c/ItemGroup\u003e\n\n ...\n\n \u003c/Project\u003e\n\nAs authentication for the Spanner Entity Framework Core provider, the [service account JSON\ncredentials](/docs/authentication/getting-started) file location should be provided in the\n`GOOGLE_APPLICATION_CREDENTIALS` environment variable. Otherwise, the provider\ncan also use the default credentials set in the Google Cloud CLI `gcloud`\napplication.\n\nUse the Spanner Entity Framework Core provider\n----------------------------------------------\n\nFor more information about the available features, limitations of the provider,\nrecommendations on how to use the provider, and for code samples, consult\nthe [reference documentation](https://github.com/googleapis/dotnet-spanner-entity-framework#readme) on\nGitHub.\n\nWhat's next\n-----------\n\n- Checkout the [code examples](https://github.com/googleapis/dotnet-spanner-entity-framework/tree/master/Google.Cloud.EntityFrameworkCore.Spanner.Samples) on how to use the Spanner Entity Framework Core provider.\n- View the repository for the Spanner Entity Framework Core provider on [GitHub](https://github.com/googleapis/dotnet-spanner-entity-framework).\n- File a [GitHub issue](https://github.com/googleapis/dotnet-spanner-entity-framework/issues) to report a bug or ask a question about the Spanner Entity Framework provider.\n- Learn more about [Entity Framework Core](https://docs.microsoft.com/en-us/ef/core/).\n- Learn more about [NuGet](https://www.nuget.org/).\n- Learn about authorization and authentication credentials in [Getting started with authentication](/docs/authentication/getting-started)."]]