microsoft / DacFx

DacFx, SqlPackage, and other SQL development libraries enable declarative database development and database portability across SQL versions and environments. Share feedback here on dacpacs, bacpacs, and SQL projects.
https://aka.ms/sqlpackage-ref
MIT License
347 stars 20 forks source link

Unable to generate bacpac/dacpac for Managed Instance databases which include External Tables. #199

Closed CliveChallinor closed 1 year ago

CliveChallinor commented 1 year ago

Steps to Reproduce:

  1. Create a Managed Instance in Azure
  2. Create a database in the managed instance
  3. Use the following script to generate objects within the database CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'dfgsdfgshrhhnfg_344f'; GO /* specify credentials to external data source

    • IDENTITY: user name for external source.
    • SECRET: password for external source. */ CREATE DATABASE SCOPED CREDENTIAL SqlServerCredentials WITH IDENTITY = 'Clive', Secret = ''; GO

      / Make sure Polybase is enabled /

      sp_configure 'POLYBASE enable',1 reconfigure go

    CREATE EXTERNAL DATA SOURCE SQLServerInstance WITH ( LOCATION = 'sqlserver://we-server.database.windows.net', DATABASE_NAME = N'***_NDW_TEST', -- PUSHDOWN = ON | OFF, CREDENTIAL = SQLServerCredentials, TYPE = RDBMS ); GO

CREATE EXTERNAL TABLE [dbo].[all_dm_exec_requests]([session_id] smallint NOT NULL, [request_id] int NOT NULL, [start_time] datetime NOT NULL, [status] nvarchar(30) NOT NULL, [command] nvarchar(32) NOT NULL, [sql_handle] varbinary(64), [statement_start_offset] int, [statement_end_offset] int, [cpu_time] int NOT NULL) WITH ( DATA_SOURCE = SQLServerInstance, SCHEMA_NAME = 'sys', OBJECT_NAME = 'dm_exec_requests' )

  1. Attempt to Extract Data Tier Application from SSMS
  2. Fails with the following TITLE: Microsoft SQL Server Management Studio

Could not extract package from specified database. Error 0: An error occurred while attempting to reverse engineer elements of type Microsoft.Data.Tools.Schema.Sql.SchemaModel.SqlExternalDataSource: Unsupported external data source type '1'. (Microsoft.SqlServer.Dac)


ADDITIONAL INFORMATION:

Unsupported external data source type '1'. (Microsoft.Data.Tools.Schema.Sql)


BUTTONS:

OK

Did this occur in prior versions? Yes

(DacFx/SqlPackage/SSMS/Azure Data Studio)

ErikEJ commented 1 year ago

Have you tried with the latest version?

CliveChallinor commented 1 year ago

Have you tried with the latest version?

Yes.....latest SSMS19 Preview