Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.74k stars 309 forks source link

SQL Server 2022 Polybase with Azurite - file in use? #2399

Open kimjamia opened 1 month ago

kimjamia commented 1 month ago

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the Azurite was used?

3.28.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

It comes with Visual Studio Community.

What's the Node.js version?

What problem was encountered?

Attempting to read a blob from Azurite using SQL Server 2022 Polybase results in error:

File 'test-file.csv' cannot be opened because it does not exist or it is used by another process.

Steps to reproduce the issue?

  1. Configure Azurite to use HTTPS using the dotnet dev-cert.
  2. Create a container and set its access level to public.
  3. Upload a csv file to the container.
  4. Create an external data source in a locally running non-containerized SQL Server 2022 and attempt to read the CSV from it:
    
    CREATE EXTERNAL DATA SOURCE MyAzureStorage
    WITH (
    LOCATION = 'abs://localhost:10000/devstoreaccount1/test'
    );

SELECT * FROM OPENROWSET( BULK 'test-file.csv', DATA_SOURCE = 'MyAzureStorage', SINGLE_CLOB ) AS DataFile;


I can access the blob file with a browser from `https://localhost:10000/devstoreaccount1/test/test-file.csv`.
I got the external data source to work with a publicly available Azure Blob Storage so this issue looks Azurite-related.