[英]Deploy existing data on ASP.NET web project from local database in Visual Studio to Azure database
I've successfully deployed my ASP.NET project to Azure but the database has been deployed with no data, consequently throwing internal server errors due to functionality requiring that data. 我已成功将ASP.NET项目部署到Azure,但是该数据库没有数据部署,因此由于需要该数据的功能而导致内部服务器错误。 I can't see the exact error message as I'm unable to disable customErrors on my project (there's no webconfig file on Razor Pages) 我无法看到确切的错误消息,因为我无法在项目上禁用customErrors(Razor Pages上没有webconfig文件)
I need to update my database on Azure with the data currently stored locally. 我需要使用当前本地存储的数据更新Azure上的数据库。 How do you do this and is this possible? 您如何做,这可能吗?
NB - I am using EF core with code-first migrations for data access NB-我将EF核心与代码优先迁移一起用于数据访问
On the local machine open the "Microsoft server SQL management studio", connect to the local database server and navigate to the appropriate database. 在本地计算机上,打开“ Microsoft服务器SQL管理工作室”,连接到本地数据库服务器并导航到适当的数据库。 Rightclick on the database name and select "Generate scripts...". 右键单击数据库名称,然后选择“生成脚本...”。 Select the tables you want to export, then click "next>". 选择要导出的表,然后单击“下一步>”。 On this screen click the "Advanced" button, scroll down to "Types of data to script" and select "Data only". 在此屏幕上,单击“高级”按钮,向下滚动到“脚本的数据类型”,然后选择“仅数据”。 Now you can generate the script and copy that to a connection to the Azure DB, that can be an other query in de Management Studio or in the Azure portal. 现在,您可以生成脚本并将其复制到与Azure DB的连接,该连接可以是de Management Studio或Azure门户中的另一个查询。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.