The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Azure App Service - Web Apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

Connection string in Application Settings does not seem to work in a simple WCF data service hosted in a web app RRS feed

  • Question

  • I have created a small wcf data service which surfaces data via the entity framework from an Azure SQL database. It works fine when the connection string is defined in the web.config file. But if I specify the connection string in the Application Settings, it doesn't (I get the error: Request Error: The server encountered an error processing the request. See server logs for more details.)

    I have done this a number of times before in other web apps that host aspx forms, so I don't think it is an error in the connection string itself, but the value (named ToucanIndexDBEntities) as defined in the Application setting is (with password obscured):

    metadata=res://*/IndexDB.csdl|res://*/IndexDB.ssdl|res://*/IndexDB.msl;provider=System.Data.SqlClient;provider connection string=”data;initial catalog=ToucanIndexDB;persist security info=True;user id=AzureToucanIndexer;password=xxxxxxxxxxxxxxx;MultipleActiveResultSets=True;App=EntityFramework”

    The associated extract from the web.config is:

    <add name="ToucanIndexDBEntities" connectionString="metadata=res://*/IndexDB.csdl|res://*/IndexDB.ssdl|res://*/IndexDB.msl;provider=System.Data.SqlClient;provider connection string=&quot;data;initial catalog=ToucanIndexDB;persist security info=True;user id=AzureToucanIndexer;password=xxxxxxxxxxxxxxxxxxxx;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

    Wednesday, February 17, 2016 11:02 AM

All replies