If using the tsql "CREATE DATABASE Database2 AS COPY OF server1.Database1;" on an Azure SQL server to copy a database between servers in different subscriptions, then this works fine when the public endpoints are both enabled on each server. If private endpoints are enabled between the two servers then the copy database function fails.

Does anyone know what is the reason for this and if there is a workaround?


Just found in the documentation:

Database copy is not supported when the source and/or destination servers have a private endpoint configured and public network access is disabled. If private endpoint is configured but public network access is allowed, initiating database copy when connected to the destination server from a public IP address will succeed. To determine the source IP address of current connection, execute SELECT client_net_address FROM sys.dm_exec_connections WHERE session_id = @@SPID;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.