Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EXTERNAL DATA SOURCE should be created before views and procedures #380

Open
asos-martinsmith opened this issue Jan 17, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working P1 P1 bug
Milestone

Comments

@asos-martinsmith
Copy link

  • SqlPackage or DacFx Version:
  • .NET Framework (Windows-only) or .NET Core:
  • Environment (local platform and source/target platforms):

Unsure - using publish in latest version of VS 2022

VisualStudio.17.Release/17.8.4+34408.163
SQL Server Data Tools 17.8.120.1

Steps to Reproduce:

  1. Have the project contain an external data source - for example
CREATE EXTERNAL DATA SOURCE [MyExternalDataSource]
    WITH (
    LOCATION = N'https://MyBlobaccountname.blob.core.windows.net',
    CREDENTIAL = [ManagedIdentityCredential]
    );
  1. Have a view or stored procedure reference that data source in OPENROWSET

SELECT PARQUET_DATA.SKU_ID
FROM OPENROWSET(
BULK 'mypath_*.parquet',
DATA_SOURCE = 'MyExternalDataSource',
FORMAT = 'PARQUET')
WITH (Foo bigint)
PARQUET_DATA

  1. Publish the project to a Synapse Serverless database that has neither of these objects.

The Publish script creates the external data source at the end but the deployment has already failed before that point as it tries to create the proc/view that references the non existent data source and the SQL Serverless throws an error about that.

Probably the placement of the data source creation should always happen before the procedures and views are created (as they can be dependent on the data source but the reverse isn't possible)

Did this occur in prior versions? If not - which version(s) did it work in?

(DacFx/SqlPackage/SSMS/Azure Data Studio)

@asos-martinsmith asos-martinsmith added the bug Something isn't working label Jan 17, 2024
@dzsquared dzsquared added the P1 P1 bug label Feb 6, 2024
@dzsquared dzsquared added this to the 162.3 milestone Feb 6, 2024
@dzsquared dzsquared modified the milestones: 162.3, 162.4 Jun 3, 2024
@dzsquared dzsquared assigned abhikum and unassigned SeenaAugusty Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 P1 bug
Projects
None yet
Development

No branches or pull requests

4 participants