Keeping database objects in sync using Azure - azure

I'm in the process of creating an Azure Website, and using SQL storage in Azure for database connectivity as well. If I wanted to follow a simple model of (website instance\database_instance):
TEST - test.website.com\test_database
STAGING - staging.website.com\staging_database
PRODUCTION - website.com\production_database
How would I go about syncing database object from TEST->STAGE->PROD? On local database, I used to use redgate tools, but I don't know if I can still use those with Azure.
I should add, I'm using Visual Studio 2012 with Azure Tools installed.. I'm not sure if there's a database project I can use to promote database objects when I publish as well?'

Presumably you used Red Gate SQL Compare and SQL Data Compare? If so, these should work with SQL Azure so long as you're not using a very old version.
Could you try it and if you come across a problem, let me know, and I'll see what I can do to escalate it.

Related

Use Azure data sync with localdb

B"H
How can I use Azure Data Sync with localdb?
Please note: I am not asking about using it with a "Local Database" as in an on-prem database. I am speaking specifically about the technology (particular Sql Server Edition) known as localdb. As in (localdb)\MSSQLLocalDB.
The issue is adding the localdb instance to SQL Data Sync Agent. The agent must be run under an entity (windows login) that has permission to run as a service. It can not be run using a windows live identity which is what the users are usually logged in as. Yet it also needs to have permissions to the database in localdb.
Use Case:
I have a central database running in Azure. With multiple users with laptops and limited internet connection, running local apps (some built in Access). Connecting directly from the apps to Azure is too slow or otherwise impractical. Therefore I install the lightweight localdb as a cache for the users data. Which will be merged using Azure Data Sync.
I am currently using a solution built directly on Microsoft Sync Framework. However there is a maintenance overhead on that solution. So I would like to migrate to the Microsoft maintained Azure Data Sync.
Thank you
B"H
Ok, it was actually a silly mistake.
You actually can run the SQL Data Sync Agent using a windows live identity. You just need to use the local user name. Which is the name of the folder for that user in the Users folder. You must also use the name of the computer in the format MyComputer\localUserName.
Once I was running the SQL Data Sync Agent under the currently logged in user - who also has access to the DB - everything else ran smoothly.

How to publish a website with sql local db database to azure using visual studio 2013

I have my website up and running on local server I want to published it to azure. I searched a lot but unable to do so however succeeded in publishing without database.Can any one provide a step by step guide how to published to azure and what tools to download from azure management portal.
Thanks.
Try this http://www.asp.net/mvc/overview/getting-started/database-first-development/publish-to-azure and let us know if you need more help. You will just need Visual Studio 2013.
You can't use localdb with Azure Websites.
That said, you can use localdb for development, but change the connection string on deployment to use some other database, such as SQL Azure (see http://azure.microsoft.com/blog/2013/07/17/windows-azure-web-sites-how-application-strings-and-connection-strings-work/)

Unable to display SQL Azure table definition in Visual Studio 2013

The error I am getting is:
Problem loading: The designer encountered an error while loading the table definition
I can view the data within the tables inside VS just fine and can even query the data too. This is a fresh install on my computer.
What I have tried:
Tried viewing the table in both "Server Explorer" and "SQL Server
Object Explorer."
Checked if my login credentials has permissions to
create tables in the "Management Portal."
Installed SSMS and still cannot show the design of the table
Tried connecting to the database using OLE DB and SQL Server data providers, but I still get the same issue
Added my IP connection to the server firewall and turned on "Windows Azure Services"
Set the connection timout counter to zero
This is the image of my error. I generated a very simple user table just for testing purposes from the Management Portal.
This is a simple test to connect to the Azure database without using a project template. This is my first time using SQL Azure just to warn you. Sure I can just stick to using the Management Portal to change the table definition and stuff like that, but I was wanting to keep everything in one program.
I have found this issue only applies when using the new "Basic/Standard" tier of databases in Azure. If you switch back to the older style "Web/Business" tiers it will start working again.
I found this on a Microsoft forum after struggling for hours. It still takes an age to load, but with the preview SSDT tools, I did get a visual editor for the first time.
Posted by Microsoft on 1/7/2015 at 1:59 PM:
This bug has been fixed in the Preview release to support Azure SQL Database Update V12
See http://blogs.msdn.com/b/ssdt/archive/2014/12/18/sql-server-database-tooling-preview-release-for-the-latest-azure-sql-database-update-v12-preview.aspx for details of this.
The fix will also be included in our next full (non-Preview) release.
Thanks,
Kevin Cunnane,
SQL Server database tooling team

How to create tables in windows azure?

I am new to windows azure.Can anyone please tell me the process of creating database and tables in windows azure and how to connect to that connection to application .we have windows azure account .please clarify my doubts.any of pdf books for deploying the rest wcf services in cloud let me know the links.
Thanks,
It is May 2014 and that Silverlight online tool just is not really much better.
Best approach is to use SSMS (SQL Server Management Studio) you can even use the free tools tool.
Connect to your Azure with the portal supplied server url / port ... and then your username /password.
Say you scripted out an existing database tables and want to execute that script, you have much more freedom and control with SSMS than online.
For table creation note that a few caveats, One that is common is that not all of T-SQL is supported and a typical script from another database table(s) you end up needed to strip off the two "ON [PRIMARY]" parts of the create statement
Click on the database server in the management portal. 1st thing you would do is manage the allowed IP Addresses which can access this server/database. Allow your local IP address there. After that you have 2 choices:
Use Sql Server Management Studio - It does not have the table editor and you would need to write T-SQL scripts manually.
Use Silverlight based database management utility - to access this, click on the Manage Url link as shown in the screenshot below.
Since you cannot have wizards for Adding/Editing tables, constraints or keys for Azure DB, even if you have connected it through MS SQL Server Management Studio, you can use RazorSQL for this purpose. It gives you a feeling like you are playing with your azure DB in management studio, same as you do with your normal DBs

How do I develop for Azure without using a live SQL Azure instance?

I have a BizSpark account and I get some Azure freebies from Microsoft. But, I'm forced to create a live SQL Azure database to use in my local development. This slows me down a bit because I have to read/write over the wire when I'm developing, and I must remain connected at all times.
Is there a way, or a technique, to build locally and have my deployments access the express edition of SQL Server on my machine? I'm using EF4 to access the database.
First of all, as a part of Bizspark, you get 3 SQL Azure databases for free. http://msdn.microsoft.com/en-us/subscriptions/ee461076.aspx
This will allow you to have 1 DB for testing, 1 for dev, and 1 for production
If this does not work out for you, you CAN develop on your local SQL Express and keep deploying your changes to SQL Azure as you deploy your application to Azure. There are two tools that help you here:
1) open-source SQL Azure Migration Wizard: http://sqlazuremw.codeplex.com/ -- we personally do not use this for deployments, so I am not super knowledgeable to comment on this. It is a decent tool to back your SQL Azure database.
2) You can use Red Gate's SQL Compare product, as of v9.0+, they support synchronizing cross SQL Azure and on-prem SQL servers. We use this for AzureWatch and are very happy. It is commercial product and is somewhat pricey.
HTH
+1 to Igorek's answer - plenty of good suggestions there.
In addition to his advice, if you are a BizSpark licensee then I suggest you deploy full SQL Server 2008 R2 to a local box and develop against that.
There are differences between full SQL Server and SQL Azure - you should read around to be aware of these - http://social.technet.microsoft.com/wiki/contents/articles/comparing-sql-server-with-sql-azure.aspx
As long as you are aware of the differences (especially the SQL Azure limitations) then migrating back to SQL Azure later, should be reasonable.

Resources