question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Azurite allows underscores in container names; Azure proper disallows them

See original GitHub issue

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

Blob.

Which version of the Azurite was used?

3.8.0

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

Docker Hub

What’s the Node.js version?

Whatever comes in the container

What problem was encountered?

Azurite allows the user to create a blob storage container with names which are not allowed by Azure proper.

In particular, I found that Azurite allows underscores in container names, which are not allowed in the real blob storage:

Container names must start or end with a letter or number, and can contain only letters, numbers, and the dash (-) character.

e.g my_test_container is allowed as a container name in Azurite, but not in Azure.

Steps to reproduce the issue?

Here’s a small Scala program that tries to create a container with an underscore:

import com.azure.storage.blob.{BlobServiceClient, BlobServiceClientBuilder}

val blobServiceClient: BlobServiceClient

blobServiceClient.createBlobContainer("my_test_container")

If I create a client that talks to Azurite, this sets the metadata, and prints the correct metadata when I call getMetadata:

val azureClient: BlobServiceClient =
  new BlobServiceClientBuilder()
    .connectionString("UseDevelopmentStorage=true;")
    .buildClient()

If I run this against our live storage account, I get an error:

Status code 400, "<?xml version="1.0" encoding="utf-8"?><Error><Code>InvalidResourceName</Code><Message>The specifed resource name contains invalid characters.

Removing the underscores (i.e. mytestcontainer) allows me to create the container.

Have you found a mitigation/solution?

n/a.

I only discovered this bug when writing a repro for https://github.com/Azure/Azurite/issues/532 and figured I’d do the good citizen thing by reporting it, but it’s not affecting my work at all.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LeeMartin77commented, May 21, 2021

Not sure whether to open this as a new issue, but I’ve just encountered something similar in Azurite 3.12.0 on VS Code - Azurite allows me to create a container with capital letters (ie. Products), whereas this fails when running against azure proper.

0reactions
BrettGorehamcommented, Nov 25, 2021

@blueww it looks like that issue was merged after I pulled the docker image! I have updated now and the short names are being rejected as expected!

Thanks for the response!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Naming and Referencing Containers, Blobs, and Metadata
The URI to reference a container or a blob must be unique. Because every account name is unique, two accounts can have containers...
Read more >
Azure table storage returns 400 Bad Request - Stack Overflow
400 Error means there's something wrong with the value of one of your properties. One way to find out is to trace the...
Read more >
Python BlobService.create_container Examples
These are the top rated real world Python examples of azurestorageblob. ... if c.name == self.azure_container ] if len(containers) == 0: self.
Read more >
Untitled
... allowances allowancing allowed allowedly allowing allows alloxan alloxans ... azotobacter azotobacters azoturia azoturias azure azures azurite azurites ...
Read more >
Archive | Jon Gallant
Adobe Lightroom Import - How to change dash in folder name to underscore ... Azure IoT allows you to define “Endpoints” and send...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found