Hi @55671899,
To Copy azure SQL database to an elastic pool the identity (<azure client id>@<azure tenant id>
) must meet these conditions:
On the Source Server (where the database is being copied from):
- The identity user must have the
dbmanager
role at the in the master database. - The identity user Must have the
db_owner
role at the in the source database.
Steps to Copy azure sql database to an elastic pool:
--Step# 1
--Create login and user in the master database of the source server.
CREATE LOGIN [azure-app-registation] FROM EXTERNAL PROVIDER
GO
CREATE USER [azure-app-registation] FOR LOGIN [azure-app-registation];
GO
ALTER ROLE dbmanager ADD MEMBER [azure-app-registation]a;
GO
--Step# 2
--Create the user in the source database and grant dbowner permission to the database.
CREATE USER [azure-app-registation] FOR LOGIN [azure-app-registation];
GO
ALTER ROLE db_owner ADD MEMBER [azure-app-registation];
GO
--Step# 3
--Sign in to the `master` database with the login that created the database you want to copy.
CREATE DATABASE Database2 AS COPY OF Database1 (SERVICE_OBJECTIVE = ELASTIC_POOL( name = pool1 ));
Here is my Output: