An Azure relational database service.
Executed EXEC sys.sp_cdc_enable_db; in master.
That sounds wrong. Why would you enable CDC for master? I think you should run it in the database that you want to enable for CDC.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
We are unable to enable Change Data Capture (CDC) on our Azure SQL Database despite using the server-level admin login (DBAdmin) and Entra ID service administrator.
Steps Performed:
text
Msg 22902, Level 16, State 1, Procedure sys.sp_cdc_enable_db, Line 32
Expected Behavior:
Business Impact:
Msg 22902, Level 16, State 1, Procedure sys.sp_cdc_enable_db, Line 32
An Azure relational database service.
Executed EXEC sys.sp_cdc_enable_db; in master.
That sounds wrong. Why would you enable CDC for master? I think you should run it in the database that you want to enable for CDC.
Hi RM,
It sounds like you’re facing an issue enabling Change Data Capture (CDC) on your Azure SQL Database, getting the error “Caller is not authorized” even while using the server-level admin login and Entra ID service administrator. Here’s a breakdown of what you might want to consider:
Possible Causes and Solutions:
1.Permissions Issue:
db_owner role on the database. The error you're seeing (Msg 22902) can often be tied back to insufficient privileges.
SELECT is_member('db_owner');
If your user doesn’t show as a member, you can add them:
EXEC sp_addrolemember 'db_owner', 'your_username';
cdc. If such entities exist, they can prevent CDC from being enabled. You may need to drop or rename these entities if they conflict.Steps to Enable CDC:
If you've confirmed the above, here are the steps to try enabling CDC again:
EXEC sys.sp_cdc_enable_db;
SELECT name, is_cdc_enabled
FROM sys.databases
WHERE name = 'YourDatabaseName';
Additional Considerations:
SUSER_SNAME() while trying to enable CDC, they can cause failures.cdc user exists and has the db_owner role assigned. If not, create it:
CREATE USER [cdc] WITHOUT LOGIN WITH DEFAULT_SCHEMA = [cdc];
EXEC sp_addrolemember 'db_owner', 'cdc';
Follow-Up Questions:
db_owner role at the database level?cdc in the database?References:
Hope this helps you get CDC up and running smoothly! If you have any more questions or run into further issues, feel free to ask.
The error message you are encountering (Msg 22902) indicates that the caller is not authorized to enable Change Data Capture (CDC) on the Azure SQL Database. Here are some steps and considerations to address this issue:
db_owner role is required to enable CDC for Azure SQL Database.EXEC sys.sp_cdc_enable_db; command. You should execute this command in the context of the database you want to enable CDC for.cdc Schema/User: Ensure that there is no existing schema or user named cdc in the database, as this could prevent CDC from being enabled. If such a schema or user exists, you will need to drop or rename it before enabling CDC.db_owner privileges, try using those to see if the issue persists.If you have verified all of the above and are still encountering issues, consider reaching out to Azure support for further assistance.
References: