简体   繁体   English

使用Visual Studio 2012将具有数据库的ASP.net Web应用程序发布到Azure

[英]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.

相关问题 使用Visual Studio 2012在ASP.NET上运行WPF应用程序 - Run WPF application on ASP.NET using Visual Studio 2012 Web应用程序发布失败-Visual Studio-C#-ASP.NET - Web Application publishing failed - Visual Studio - C# - ASP.NET 将Asp.Net Mvc,Web Api应用程序发布到Windows Azure - Publishing an Asp.Net Mvc,Web Api Application to Windows Azure 使用asp.net Web表单Visual Studio 2012将图像插入Oracle数据库 - insert image into oracle database with asp.net web forms visual studio 2012 Visual Studio 2012中“ /”应用程序中的ASP.NET服务器错误 - ASP.NET Server Error in '/' Application in Visual Studio 2012 在Visual Studio 2012中发布Web应用程序后,文件夹丢失 - Folders are missing after publishing web-application in visual Studio 2012 如何使用.net 3.5在Visual Studio 2008,asp.net Web应用程序中生成QR码? - How to generate QR code in visual studio 2008,asp.net web application using .net 3.5? 使用Visual Studio 2012 Express for Web将Web API和文件夹引用添加到空ASP.NET项目 - Adding Web API and folder references to empty ASP.NET project with Visual Studio 2012 Express for Web 如何在不使用 Visual Studio 的情况下直接在 Dockers 容器上运行 ASP.NET Core Web 应用程序 - How to run an ASP.NET Core Web Application on Dockers container directly without using Visual Studio 如何在Visual Studio 2012的(数据库)表中手动存储图像并在ASP.NET MVC中使用jquery ajax进行检索 - How to manually store image in (database) table in visual studio 2012 and retrieve using jquery ajax in asp.net mvc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM