Search code examples
sqlazuresql-server-data-tools

Propagating changes to a database schema in Azure back to Visual Studio?


I created a database using the Azure portal. I then downloaded the starter project Azure created for me and opened it in Visual Studio. I set the login settings, chose to register it as a Data-tier application, and opted for the SSDT database drift detection via the Block Publish option. I then successfully published the database to Azure after updating the IP address firewall to accept my IP address for remote database administration.

From within the Azure portal itself I added a table and defined some columns and indices. My question is, how can I propagate the changes I made in the Azure portal back to the starter project I have in Visual Studio 2012? Although I am an experienced C# developer, I am new to the Azure platform. I am using Visual Studio 2012 Ultimate if that matters.


Solution

  • This is not specific to Azure, using SSDT you can perform schema comparison between your DTA and any other database (on the SQL menu, select Schema Compare, and then click New Schema Comparison, then choose the source and the target of your comparison).

    As long as you have this comparison as a project item, you can either directly update your source with the changes or generate an update script that would do it for you (if you don't have enough rights for these changes, for example).

    Here on MSDN you find a tutorial on this topic.