I am using Azurite 3.33.0 to emulate Azure Blob Storage locally, and I am trying to query blobs by multiple tags using the find_blobs_by_tags method. This should recently have been fixed by Azurite (https://github.com/Azure/Azurite/issues/647). However, I am encountering issues when attempting to query blobs with multiple conditions for a single tag. Specifically, the query fails with an HttpResponseError (Internal Server Error) when I try to filter using multiple conditions.
The following query works fine for filtering by a single tag:
blob_service_client = BlobServiceClient(
account_url=azure_blob_storage_endpoint, credential=credentials
)
container_client = blob_service_client.get_container_client(
container=container_name
)
start_year = 2012
end_year = 2022
query = f"\"year\">='{start_year}'"
next(container_client.find_blobs_by_tags(filter_expression=query))["name"]
However, it fails when I attempt to apply two conditions on a single tag to define a range like this:
query = (
f"\"year\">='{start_year}' AND \"year\"<='{end_year}'"
)
next(container_client.find_blobs_by_tags(filter_expression=query))["name"]
I get the following error: azure.core.exceptions.HttpResponseError: Internal Server Error ErrorCode: None The debugs show the following error:
info: HandlerMiddleware: DeserializedParameters={"options":{"where":"\"year\">='2012' AND \"year\"<='2022'","include":[],"requestId":"65c52b18-d417-11ef-84c3-c84bd64ac0da"},"restype":"container","comp":"blobs","version":"2025-01-05"}
error: ErrorMiddleware: ErrorName=Error ErrorMessage=can't have multiple conditions for a single tag unless they define a range ErrorStack="Error: can't have multiple conditions for a single tag unless they define a range\n at QueryParser.validateWithPreviousComparison (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:81:27)\n at QueryParser.visitBinary (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:249:26)\n at QueryParser.visitExpressionGroup (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:208:25)\n at QueryParser.visitUnary (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:189:28)\n at QueryParser.visitAnd (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:170:27)\n at QueryParser.visitAnd (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:173:32)\n at QueryParser.visitOr (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:149:27)\n at QueryParser.visitExpression (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:139:21)\n at QueryParser.visitQuery (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:126:27)\n at QueryParser.visit (/opt/azurite/dist/src/blob/persistence/QueryInterpreter/QueryParser.js:118:21)"
My code does work when I am querying on the actual Azure Blob Storage, just in my azurite blob storage it fails.
Questions:
- Is querying multiple conditions on a single blob tag not supported in Azurite 3.33.0?
- Are there any known issues or limitations with find_blobs_by_tags in Azurite 3.33.0 that could explain this behavior?

