My understanding is that in order to implement Azure AD Managed Service Identity access to a SQL Database in Azure, I would need to create a SqlConnection
with a retrieved token.
To add that token to the SqlConnection
, .NET 4.6+ has an AccessToken
property to do this. .NET Core 2.0 does not.
Is there any way around this?
Implementing Azure AD Managed Service Identity in a core app doesn't seem possible at this point unless I am misunderstanding.
As of SqlClient package 4.6.0, SqlConnection
now supports AccessToken
for SqlClient
of .NET Core 2.2.
https://www.nuget.org/packages/System.Data.SqlClient/
A workaround would be to store the connection string in Azure Key Vault and then implement MSI to retrieve it from Key Vault.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With