ExportBacpac DacServices exception with Windows users

I am using the Data Layer Application Platform (DACFx), trying to export schema and data from a subset of tables in my database.

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

I know that there are some restrictions on what is supported, and I examined code-related issues (stored procedures, etc.). However, I hit the block using Windows Users / Logins. I am not sure how I can get around this.

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 understand that Windows authentication is not supported in Azure SQL. But is it not possible to simply ignore users, logins, etc.?

I read various posts that claim that you can just DROP logins and users. and then re-CREATE them after export. Unfortunately, I cannot do this in my case, since these objects are used for active connections. I also read that some people solved this by doing a backup / restore and then dropping users on the secondary. This may potentially work, but certainly a better way with less effort.

By decompiling the code, I see where the ExportBacpac method is created:

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

Of course, this is all personal, internal, etc. Shame, I would like to disable EnfoceSqlAzureRestrictions!

Any ideas?

+4
source share

Source: https://habr.com/ru/post/1668573/


All Articles