I wrote a small application for backing up Azure SQL databases using the very useful CREATE AS COPY OF command in SQL Azure. eg.
CREATE DATABASE MyNewDB AS COPY OF MyOldDB
I run this command with the administrator name (the first input you get when creating the server). My question is: what are the minimum permissions for a new login to execute the above command?
So far I have done:
CREATE LOGIN DBCreator WITH PASSWORD = '?????????????'
CREATE USER DBCreator FROM LOGIN DBCreator;
EXEC sp_addrolemember 'dbmanager', 'DBCreator';
CREATE USER DBCreator FROM LOGIN DBCreator;
EXEC sp_addrolemember 'db_datareader', 'DBCreator';
And the result when executing the above CREATE DATABASE command:
CREATE DATABASE permission denied in database 'MyOldDB'.
source
share