Context: I have my ASP.NET MVC4 solution deployed in Azure.
My MSSQL Server Database is also there, in Azure.
I currently deploy this way:
In web.config I change the connection string from local database (sdf) to azure database (connectionString="Server=tcp:.....database.windows.net, ..."
)
Right click on project name (visual studio), and then "Publish"
So, my question is:
How do I use the Update-database
command in the Package Manager Console?
Is it this way?
I want to be sure about this. Also, I guess I should add the firewall IP exception from Azure before running step #2
Yes, you are right. At least that is how it worked for me:
On the other hand, due to your situation ("I want to be sure about this") i recommend to duplicate the database in Azure and test this steps with this backup.
Hope it helps.
EDIT due to comment:
Check this out: Triggering EF migration at application startup by code
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With