[英]Publishing ASP.net web application with database to Azure using Visual Studio 2012
I have developed a simple web application. 我已经开发了一个简单的Web应用程序。 I have written it in VS2012 using ASP.net and C#.
我已经在VS2012中使用ASP.net和C#编写了它。 It links to a SQL database on my local machine in SQL Server Express.
它链接到我在SQL Server Express中的本地计算机上的SQL数据库。 It works fine inside the debug environment on my local machine.
在本地计算机上的调试环境中,它运行良好。
I have an account with Windows Azure. 我有一个Windows Azure帐户。 I create a new website and database using the webform.
我使用Webform创建一个新的网站和数据库。 I log in and synch the publish certificate in my VS2012.
我登录并同步了我的VS2012中的发布证书。 As I work through the wizard I test the connection and it connects.
当我通过向导工作时,我测试了连接并建立了连接。 I get the connection string for the Azure database from the Azure portal and I enter it in the "Remote Connection String" field.
我从Azure门户获取Azure数据库的连接字符串,然后在“远程连接字符串”字段中输入它。 I complete the wizard and it says it publishes successfully.
我完成了向导,并说它已成功发布。
However I get a "403 Forbidden Error" instead of my web application in the browser. 但是,我在浏览器中收到的是“ 403 Forbidden Error”,而不是我的Web应用程序。 When I look at the Azure portal, I find that the database is not populated at all.
当我查看Azure门户时,发现根本没有填充该数据库。 I feel like there is an important step I am missing to make this work.
我觉得要完成这项工作我缺少重要的一步。 Any help would be appreciated.
任何帮助,将不胜感激。
you can try to get the script from your database then insert into the sql azure via the scripting of your sql server database. 您可以尝试从数据库中获取脚本,然后通过sql server数据库的脚本插入sql azure。 The script will contain any relationship such as PK or FK from there, you can add a web-config line to link your sql azure with your website like this
该脚本将从那里包含任何关系,例如PK或FK,您可以添加一个Web配置行以将sql azure链接到您的网站,如下所示
<connectionStrings>
<add name="ConnectionString" connectionString="Server=**(will be given in sql azure)" /
</connectionStrings>
This should work already. 这应该已经可以了。 Of course you got to make sure your publish profile is the new one.
当然,您必须确保您的发布个人资料是新的。 Don't use the old publish profile.
不要使用旧的发布配置文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.