microsoft / referencesource

Source from the Microsoft .NET Reference Source that represent a subset of the .NET Framework
https://referencesource.microsoft.com/
MIT License
3.17k stars 1.27k forks source link

How to connect the database connection of SQLDependency using managed identity in Azure? #194

Open ryms-nnit opened 10 months ago

ryms-nnit commented 10 months ago

READ BEFORE FILING

Do not file issues regarding functionality of the .NET Framework. This repo only tracks infrastructure issues regarding the following items:

This repository does not accept feature requests or bug reports. To submit those, you need to go elsewhere:

David-Engel commented 10 months ago

Use Microsoft.Data.SqlClient (NOT System.Data.SqlClient) and the connection string option Authentication=Active Directory Managed Identity: https://learn.microsoft.com/en-us/sql/connect/ado-net/sql/azure-active-directory-authentication?view=sql-server-ver16#using-active-directory-managed-identity-authentication