Neil Pittman
Neil Pittman

Reputation: 379

Publishing ASP.net web application with database to Azure using Visual Studio 2012

I have developed a simple web application. I have written it in VS2012 using ASP.net and C#. It links to a SQL database on my local machine in SQL Server Express. It works fine inside the debug environment on my local machine.

I have an account with Windows Azure. I create a new website and database using the webform. I log in and synch the publish certificate in my 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. 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. When I look at the Azure portal, I find that the database is not populated at all. I feel like there is an important step I am missing to make this work. Any help would be appreciated.

Upvotes: 0

Views: 596

Answers (1)

Bryan
Bryan

Reputation: 8697

you can try to get the script from your database then insert into the sql azure via the scripting of your sql server database. 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

<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.

Upvotes: 1

Related Questions