locked
Add db to VS project post creation RRS feed

  • Question

  • From: MrFreeman @biggestsonicfan via Twitter

    @AzureSupport Actually, I created my project in VS without configuring a database in the Azure app setup. Can I add it post creation?

    Thanks,

    @Azuresupport

    Saturday, February 13, 2016 3:33 PM

All replies

  • Greetings,

    I created my first MVC5 application and began following tutorials. However the tutorial to add an MVC5 web app with a database requires setup during the project's creation.

    My application now has a database, but only the website is ready to publish and not the database. There's not much in the database now so I can recreate it if I need to to be uploaded with the web app onto Azure, but I don't really see any way to do this post-project-creation.

    Here is the tutorial I am currently following: http://www.asp.net/mvc/overview/getting-started/database-first-development/publish-to-azure

    Any help would be much appreciated. I suppose I could keep the code, delete the project from Azure, recreate it with the database and manually copy and paste all my code one at a time, but I feel there should be a way to do this post-creation.

    Thanks!

    Saturday, February 13, 2016 3:46 PM
  • I had serious problems uploading my sql database to Azure.

    So I created my database online instead.

    It doesn't take much code to create a database and table.


    n.Wright


    Saturday, February 13, 2016 7:49 PM
  • You shouldn't have to change anything with your code. I think the easiest way to fix this is to repeat the steps to publish the app, this time creating a new Web App with a database. After it's working, you can delete your original Web App from Azure.

    Follow the steps in the article you linked to. When the Publish dialog pops up, select the Profile tab on the left side. Instead of selecting an existing Web App, click New... and follow the rest of the instructions. You'll have to give a new name to the Web App. Seeing that this is a tutorial, I assume you'd be okay with that. If not, you'll have to delete the Web App from Azure first before creating the new one.

    To delete the original Web App, you can do it by logging into the Azure Portal at https://portal.azure.com/

    Saturday, February 13, 2016 10:56 PM
  • You shouldn't have to change anything with your code. I think the easiest way to fix this is to repeat the steps to publish the app, this time creating a new Web App with a database. After it's working, you can delete your original Web App from Azure.

    Follow the steps in the article you linked to. When the Publish dialog pops up, select the Profile tab on the left side. Instead of selecting an existing Web App, click New... and follow the rest of the instructions. You'll have to give a new name to the Web App. Seeing that this is a tutorial, I assume you'd be okay with that. If not, you'll have to delete the Web App from Azure first before creating the new one.

    To delete the original Web App, you can do it by logging into the Azure Portal at https://portal.azure.com/

    I mean I can do this, but I'm sure I'm not the first, nor the last to have this happen. It's silly that I can't go back to that part of the wizard to just re-create the database with Azure uploading.
    Sunday, February 14, 2016 7:23 AM