Good morning all, does anyone have an example implementation using MSI authentication for an Azure SQL Db used as a token cache?
I'm trying to get the credentials out of the connection string and use a token but there doesn't seem to be a place to pass it in:
services.AddMicrosoftIdentityWebAppAuthentication(Configuration)
.EnableTokenAcquisitionToCallDownstreamApi(new[] { "https://database.windows.net//.default" })
.AddDistributedTokenCaches();
services.AddDistributedSqlServerCache(options =>
{
options.ConnectionString =
Configuration.GetConnectionString("MyDbConnection");
options.SchemaName = "dbo";
options.TableName = "App_Token_Cache";
options.DefaultSlidingExpiration = TimeSpan.FromMinutes(90);
});
Do I need to create my own Cache service to accomplish this?