Using a LocalDb MDF file on Azure

前端 未结 2 617
花落未央
花落未央 2020-12-08 06:49

I am developing an ASP.NET MVC website, which I want to host on Azure Websites. While in development, I have been using an MDF file in my App_Data directory with a connectio

相关标签:
2条回答
  • 2020-12-08 06:55

    You'll have to use SQL Azure to use the Websites/Cloud Service features.

    If you haven't already you'll probably want to have a look at web.config transformations with web deploy to ease the publishing experience.

    http://msdn.microsoft.com/en-us/library/dd465318(v=vs.100).aspx

    http://www.hanselman.com/blog/TinyHappyFeatures3PublishingImprovementsChainedConfigTransformsAndDeployingASPNETAppsFromTheCommandLine.aspx

    You can import your data into the SQL Azure DB via the management tools or if you're using SQL Server 2012 you can import/export data via the portal.

    0 讨论(0)
  • 2020-12-08 06:58

    You can't use an .mdf file in App_Data, but you aren't forced to SQL Azure -- you can use SQL Server Compact. Deployment from LocalDB to Compact is easy if you are using Code First Migrations; otherwise you will have to migrate to SQL Server Compact before you deploy. If you decide to go with Compact you'll have to make sure the database engine gets deployed, and you can find instructions for that in this tutorial:

    http://www.asp.net/mvc/tutorials/deployment/deployment-to-a-hosting-provider/deployment-to-a-hosting-provider-deploying-sql-server-compact-databases-2-of-12

    0 讨论(0)
提交回复
热议问题