locked
Entity Framework, connection string & Management Portal: bug? RRS feed

  • Question

  • Hello,

    I'm using Azure Web Sites (preview). From the Management Portal I can override entries in the appsettings and connectionstring sectiona of my web.config. I'ts a very useful feature.

    But I have a problem with connection strings used by Entity Framework. The original connection string looks like:

    <add name="MyConnStr" connectionString="metadata=res://*/....." providerName="System.Data.EntityClient"/>

    From the management portal I can change the connectionString but Azure also change the providerName. From the portal I can specify "SqlAzure", "SqlServer", "MySql".  How can I specify "EntityFramework". "SqlAzure" and "SqlServer" override providerName with System.Data.SqlClient. It's wrong. Entity Framework requires System.Data.EntityClient.

    A connection with System.Data.SqlClient instead of System.Data.EntityClient throws the exception:

     System.ArgumentException: The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

    I think it's limitation of the Management Portal. Please, add "EntityFramework" in the dropdownlist on the portal.  :)

       Fabrizio

    Saturday, September 1, 2012 5:40 AM

Answers

  • Hi, Fabrizio. I believe you are right. I will forward this information on to our team and let them know. I appreciate the feedback!


    Jim Cheshire | Microsoft

    Wednesday, September 5, 2012 1:42 PM

All replies

  • Hi, Fabrizio. I'll pass this along to the Portal team. Have you tried adding the connection string to the web.config file and then deploying?


    Jim Cheshire | Microsoft

    Tuesday, September 4, 2012 6:22 PM
  • Hi Jim,

    yes, if I put the right connetion string in my local web.config and I remove the override from portal, it works fine.  I have done other test: I'm quite sure it's an issue with "providername".

       fabrizio

    Tuesday, September 4, 2012 7:09 PM
  • Hi, Fabrizio. I believe you are right. I will forward this information on to our team and let them know. I appreciate the feedback!


    Jim Cheshire | Microsoft

    Wednesday, September 5, 2012 1:42 PM
  • Jim, please let me know when the issue will be solved.  Actually I'm using a bad workaround. I'd like to use the portal to override my web.config entries. 

    Wednesday, September 5, 2012 1:52 PM
  • Fabrizio,

    I don't have a definite date on that. I'll notify the product group on this and then it will have to be triaged and decided upon by them.


    Jim Cheshire | Microsoft

    Thursday, September 6, 2012 2:05 PM
  • Is there any progress regarding this bug?

    Friday, November 2, 2012 11:51 AM
  • Are you able to do this using the new "Custom" option for connection string in the portal?


    Jim Cheshire | Microsoft

    Friday, November 2, 2012 6:18 PM
  • Not that I have been able to determine! as soon as I select the "Custom" option my connection string is excluded from the publish profile AND the Config file.

    matthew Hintzen

    Friday, December 14, 2012 1:25 AM
  • Are you able to do this using the new "Custom" option for connection string in the portal?


    Jim Cheshire | Microsoft

    That worked for me - see my self-answered question on Stackoverflow: http://stackoverflow.com/questions/14459748/how-do-i-set-an-ado-net-entity-framework-connection-string-via-the-windows-azure
    Friday, January 25, 2013 4:32 PM