Logged in as a member of an Azure AD Group Error while Deploying DACPAC

Quite a long title for a short blog post 🙂
While deploying a DACPAC (from a SQL Server Data Tools Database Project) through Azure Devops, I got the following error message:

The user attempting to perform this operation does not have permission as it is currently logged in as a member of an Azure Active Directory (AAD) group but does not have an associated database user account. A user account is necessary when creating an object to assign ownership of that object. To resolve this error, either create an Azure AD user from external provider, or alter the AAD group to assign the DEFAULT_SCHEMA as dbo, then rerun the statement.

Guess the SQL Server team didn’t get the memo that Azure AD has been renamed to Entra ID. Anyway, the Azure Devops pipeline uses a service connection defined in Devops, and in that service connection a user-defined managed identity is configured that has contributor access on the resource group that contains the Azure SQL DB. Furthermore, that managed identity is an actual user in the database, so the error message is completely misleading. The error was thrown when the following SQL script was executed:

CREATE SCHEMA myschema AUTHORIZATION dbo;

Turns out, the managed identity didn’t have the CREATE SCHEMA permissions, and it’s not part of the dbo role, so the CREATE SCHEMA script fails with the error above. I created the necessary schemas with a more privileged user and then the deployment pipeline ran without issues.


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂
Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

Recent Posts

Export a Power BI Report that cannot be Downloaded

Yes, you're reading that right, we're going to download a report that cannot be downloaded.…

1 week ago

dataMinds Connect 2025 – Slides & Scripts

You can find all the session materials for the presentation "Indexing for Dummies" that was…

1 month ago

Cloud Data Driven User Group 2025 – Slides & Scripts

The slidedeck and the SQL scripts for the session Indexing for Dummies can be found…

2 months ago

Retro Data 2025 – Slidedeck

You can find the slides of my session on the €100 DWH in Azure on…

2 months ago

Secure Logic Apps with OAuth Authorization

I've used Logic Apps a couple of times over the past years for simple workflows,…

2 months ago

Free Online Sessions – Building the €100 DWH and Indexing for Dummies

I'm giving two online sessions soon on virtual events that are free to attend. The…

2 months ago