Skip to content

3. Using SQL Server with a connection string

Compare
Choose a tag to compare
@mderriey mderriey released this 20 Feb 02:47
514d8f2

Now that we've seen how Azure Identity integrates with the Azure SDK, we see how we can do it with SQL Server.

As a first step, we create a basic implementation that uses Dapper to get the list of people displayed in the app.
We use Dapper as a first step because we're in control of the lifetime of the SqlConnection instances, which will make it easier to introduce AAD authentication later.

To get started, I recommend using the updated AzureIdentityLivestream.PeopleGenerator project:

  • The create-person-table.sql file allows you to create the table with the expected schema quickly.
  • Running the generator project will use the SqlConnectionString value in appsettings.json to create rows in the aforementioned table.

Diff from previous tag: 2.blob-storage-with-aad-auth...3.sql-with-connection-string