The connection string in web config saves the user name and password but I don't want to save Password in web config.
I am using Entity Framework in my application. Now I am trying to use the Azure SQL database with managed identity.
I tried to use the Secure Azure SQL Database connection from App Service using a managed identity tutorial in the docs
My connection string in web config:-
add name="Context" connectionString="metadata=res:///PubsuiteModel.csdl|res:///PubsuiteModel.ssdl|res://*/PubsuiteModel.msl;provider=System.Data.SqlClient;provider connection string="server=servername.database.windows.net;database=dbname;UID=AnyString;Authentication=Active Directory Interactive;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient"
When I am trying to fetch the records from the db I am getting the below error:-
Error:-The underlying provider failed on Open.
InnerException = Failed to instantiate an authentication provider with type 'Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider, Microsoft.Azure.Services.AppAuthentication' for 'ActiveDirectoryInteractive'.
How do I create a connection string for entity framework with azure SQL database with managed Identity?