Keyword not supported: 'data source'. - Azure

asp.net-mvc azure c# entity-framework entity-framework-6

Question

I am using Entity Framework in a MVC web application. My database is in azure and I am deploying my web app to azure. But when I deploy the application I receive the error below. I do NOT receive this error while debugging even though I am connecting to the same database.

Error

Keyword not supported: 'data source'.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Keyword not supported: 'data source'.

Conn String

<add name="SoccerEntities" 
     connectionString="metadata=res://*/Models.MyModel.csdl
                               |res://*/Models.MyModel.ssdl
                               |res://*/Models.MyModel.msl;
                       provider=System.Data.SqlClient;
                       provider connection string='server=tcp:<servername>,1433;
                                                   initial catalog=MyDB;
                                                   persist security info=True;
                                                   user id=user;
                                                   password=pwd;
                                                   MultipleActiveResultSets=True;
                                                   App=EntityFramework'" 
                        providerName="System.Data.EntityClient" />    
1
1
12/19/2016 3:24:19 PM

Accepted Answer

Found the answer. Apparently there are some default connections strings set in the Azure IIS Web App out-of-the-box. I'm not sure why my Web.config wasn't overriding these settings but it wasn't. I had to set a default conn string in the admin panel.

In Azure Admin Panel:

Select App -> Application Settings -> Enter new Connection String -> Save

-1
12/19/2016 8:32:01 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow