0

I've spent the last few months creating a web application in visual studio, with the intention of publishing it to Azure. It uses the Single User Authentication option that VS provides.

When I first created the web application and registered a user it created the aspnet tables in a local database. I didn't really know what that meant when I first started the app, but I created all my tables that I needed for my app in the same local database

Now that I've completed the application and tried to publish the web app - I get an error on trying to access the database. I expected that - because it's still a local database.

But I have no idea how to convert a local database to something that can be deployed to azure, and then on top of that how to reference that newly deployed database in my web app.

  • How do I/Can I convert it to a SQL Server Database Project so I can publish it online?

I've tried reading the Microsoft documents but they are for the old versions of visual studio.

I have considered creating a new project and then first making sure my web app is connected to a SQL Server Database Project so I can publish both, but then how will my app know not to create the AspNet tables in the local database and use my SQL Server Database Project.

  • How can I make sure that Single User Authentication Tables are not created locally, and instead are creating in a Database Project so they can be deployed

What I can't wrap my head around is how to ensure the Single User Authentication tables (when created) are placed where I want them to go (in this case, a SQL Server Database Project in the same Solution as the Web Application).

impo
  • 747
  • 1
  • 11
  • 37
  • 1
    SUA is not a database (although you kinda can store passwords there). You are probably using LocalDB. Have a look at [How to transfer ASP.NET MVC Database from LocalDb to SQL Server?](https://stackoverflow.com/questions/29113209/how-to-transfer-asp-net-mvc-database-from-localdb-to-sql-server). It is probably what you are looking for, and if it doesn't help completely, you at least get used to where you find the related settings and how you can look at your database. This might help to figure out what's not working, as currently, it's a bit hard to pinpoint your actual problem. – Solarflare Jun 30 '17 at 13:28
  • That looks like it will work. But I'm still a little confused about the SUA - cause it makes tables for it in the local db (even if I don't have a local db). Would you happen to know of any documents where I can read up on SUA and how it works within VS? – impo Jun 30 '17 at 14:40
  • 1
    you can look at this blog - https://dotnetpublish.wordpress.com/2016/07/05/publish-an-asp-net-core-web-app-with-ef-migrations-to-azure-appservice/ In VS 2017, the Publish UI is a little different but you should still find all the options. for e.g: To view Preview you need to click the Preview link, For setting the connection strings, you need to click Settings link. – vijayrkn Jun 30 '17 at 17:06
  • I'll check that out, thank you very much! – impo Jul 01 '17 at 03:57

0 Answers0