Azure / Azurite

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

Azurite default Location or specified location ignored with Blob in Visual Studio Code and Python #1620

Open PingPongSet opened 2 years ago

PingPongSet commented 2 years ago

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

blob, didn't test other types.

Which version of the Azurite was used?

3.18.0

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

Visual Studio Code Extension

What's the Node.js version?

14.17

What problem was encountered?

default Location or specified location ignored with Blob

Steps to reproduce the issue?

Azurite with VS Code and Python, I have the issues below:

1) Create a new container newcontainer using the code below, but I cannot see the newly created container either from the default folder or the specified Location like below:

   def read_csv(container, filename):
       AZURE_STORAGE_CONNECTION_STRING = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;'
       blob_service_client = BlobServiceClient.from_connection_string(AZURE_STORAGE_CONNECTION_STRING)
       #the newly created container cannot be found in the default location or the specified location. 
       new_container = blob_service_client.create_container("newcontainer")   
       #cannot find the existing container and blob even though it exists.
       blob_client = blob_service_client.get_blob_client(container=container, blob=filename)

2) After calling get_blob_client(container=container, blob=filename), it errors that the blob cannot be found even though it exists.

image

blueww commented 2 years ago

@PingPongSet

It looks I can't repro the issue with latest Azurite (3.18.0) in VS extension.

Have you restart Azurite everytime after change the location? (Azurite will get the updated location when start it.)