0
votes

I get this error when using Azurite in VS Code with Python in Win 10.

The specified blob does not exist.

Code below:

The code can see the container test, but cannot see the blob a.csv.

AZURE_STORAGE_CONNECTION_STRING = 'DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;'

   # Create a container for Azurite for the first run
    blob_service_client = BlobServiceClient.from_connection_string(AZURE_STORAGE_CONNECTION_STRING)
    container_client = blob_service_client.get_container_client('test')
   
    for blob in container_client.list_blobs():  #It has no blobs wrongly
        print("Found blob: ", blob.name)  #not hit here

    blob_client = blob_service_client.get_blob_client(container='test', blob='a.csv'))

    # Retrieve extract blob file
    blob_download = blob_client.download_blob()

The file in local storage below:

enter image description here

From above, __blobstorage__ folder is in the project root folder, container test under __blobstorage__, a.csv under test container.

Below showing azurite is running in VS Code:

enter image description here