DacServices ExportBacpac Exception with Windows Users
Asked Answered
S

0

8

I'm using the Data-tier Application Framework (DACFx) in an attempt to export schema and data from a subset of the tables in my database.

var dacServices = new DacServices(connectionString);
dacServices.ExportBacpac("database.bacpac", database, tables);

I know there are some limitations on what is supported, and I've addressed the issues that had to do with the code (stored procedures, etc). However, I've hit a block with Windows Users/Logins. I'm not sure how I can get around it.

The exception details:

One or more unsupported elements were found in the schema used as part of a data package.
Error SQL71564: The element User: [Domain\User] has property AuthenticationType set to a value that is not supported in Microsoft Azure SQL Database v12.
Error SQL71564: The element Login: [Domain\User] has property IsMappedToWindowsLogin set to a value that is not supported in Microsoft Azure SQL Database v12.

I realize Windows Authentication is not supported in Azure SQL. But is there not an option to simply ignore Users, Logins, etc.?

I've read various posts that claim you can just DROP the logins and users. and then re-CREATE them following the export. Unfortunately, I can't do that in my case since these objects are being used for active connections. I've also read that some people solved this by doing backup/restore and then dropping the users on the secondary. That could potentially work but surely there's a better way with less effort.

De-compiling the code, I can see where the ExportBacpac method creates:

DacExtractOptions extractOptions = new DacExtractOptions()
      {
        EnforceSqlAzureRestrictions = true,
        IgnorePermissions = false,
        VerifyExtraction = true,
        ExtractNonApplicationDatabaseScopedElements = true
      };

Of course, this is all private, internal, etc. Shame, I'd like to turn EnfoceSqlAzureRestrictions off!

Any ideas?

Sankaran answered 2/2, 2017 at 1:35 Comment(2)
Have you looked at using a publish profile and SQLPAckage.exe. You can use the advanced options to excldue users and logins from being published devblogs.microsoft.com/ssdt/…Curitiba
Hello, I am answering a bit late but the issue is still present (in my case for an "orphaned" login) and there's no obvious option to skip logins (which I don't care, I just need tables). Did you find a solution please John ?Choplogic

© 2022 - 2025 — McMap. All rights reserved.