4

(Here is a problem with a similar issue: Publish to SQL Azure fails with 'Cannot drop the external data source' message)

There is this new pattern called Sql Db Elastic Query (Azure).

The gist of it is captured here:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-elastic-query-overview

Now, I have a SqlProj that defines:

  • External Data Source (EDS) and
  • Database Scoped Credentials (DSC)

To prevent passwords being in the script (I am using SqlCmd variables)

I probably have a gazillion views on "external" tables, based on the elastic query pattern.

And during DACPAC deployments to SQL Azure, I always get an error on:

Error SQL72014: .Net SqlClient Data Provider: Msg 33165, Level 16, State 1, Line 1 Cannot drop the external data source 'XXXX' because it is used by an external table.
Error SQL72045: Script execution error.  The executed script:
DROP EXTERNAL DATA SOURCE [XXXX];

Checking the logs, I realize that there are all these Views/Tables that exist and use these EDS/DSC combo.

The work around comes with a price that's ever deepening. So the question is, has anyone else hit this problem and found the root cause of this?

0 Answers0