azure-functions-dotnet-worker/samples/EntityFramework
Jacob Viau 274b9b8cd1
Update sample packages and projects (#2836)
2024-11-08 10:01:08 -08:00
..
EntityFramework.csproj
HttpTrigger.cs
Models.cs
Program.cs
README.md
host.json
local.settings.sample.json
test.http

README.md

.NET 5 Entity Framework Sample (Azure Functions)

Setup

  1. Clone the repo
  2. Rename local.settings.sample.json to local.settings.json and fill in connection strings
  3. Install the dontnet-ef tool: dotnet tool install --global dotnet-ef
  4. Set the connection string for migration $env:SqlConnectionString="Server=tcp:my.database.windows.net,1433;......"
  5. Create the initial migration dotnet ef migrations add initial
  6. Update the database dotnet ef database update
  7. Run the function project with func start
  8. Call the different operations in the ./test.http file (file format is for RESTClient in VS Code)