I am trying to encrypt my app service's connection string via Azure Key Vault and this guide and I am getting the following error:
The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.
I originally thought it was because of the " characters in the string so I replaced those with actual "'s. Now I'm thinking it may be because it is not a normal connection string, but a db first entity framework one as shown:
connectionString="metadata="res://*/Models.{Project}.csdl|res://*/Models.{Project}.ssdl|res://*/Models.{Project}.msl";provider=System.Data.SqlClient;provider connection string="data source={datasource};initial catalog={db};persist security info=True;user id={id};password={password};MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
(bracketed values are there just to hide the sensitive info). How do I get this to work w/ Azure Key Vault?
CodePudding user response:
Please check the below ways that may solve the issue.
1 . The configuration file might have "
instead of "
, .The web sites in azure must change "e value to “
from connection string.Also check if it is properly configured in portal.
(or)
2 . Along with try 1 ,select "Custom" type of connection string instead of "SQL server" or "SQL azure"( as shown in provided link) for the Entity Framework while configuring connection string in app service.
CodePudding user response:
I figured it out. the ONLY quotes in the connection string have to be from after provider connection string= and at the end and most importantly they need to be SINGLE QUOTES i.e '.