Is it possible to run cross-database, actually cross-subscription, in Azure SQL?
I have three subscriptions (Dev, Test and Prod) and I need to need to keep Test up to date with Prod.
Unless I'm not reading the many sites correctly they seem to all assume that the databases are in the same subscription albeit possibly different servers.
Best Answer
Yes Elastic queries across subscription is possible.
There are several limitations to this feature. For example:
Read this for details: Azure SQL Database elastic query overview (preview)
Create 2 resource groups in two different subscriptions. Create one Azure SQL Server and one empty Azure SQL database in each resource group. Then you can follow along with the following code.
I used the following names in my setup:
--Connect taiobeqdemo1.database.windows.net
--Change database context to taiobCustomer
--Connect taiobeqdemo2.database.windows.net
--Change database context to taiobOrders
--Connect taiobeqdemo1.database.windows.net
--Change database context to taiobCustomer
--Connect taiobeqdemo2.database.windows.net
--Change database context to taiobOrders
Now you are to do run elastic query from
taiobeqdemo1.database.windows.net
serverstaiobOrders
database.--Change context to taiobOrders