Azure / Azure/Azurite

Please introduce startup option to create containers up front, or to create containers automatically

Open
#1,968 6 comments 21 reactions 1 assignee Claimed by @blueww View on GitHub
blob-storage enhancement
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

Please introduce startup option to create containers up front, or to create containers automatically. This will be useful in the scenarios where the production infrastructure takes care of container creation.

Without this feature, it is harder to follow these recommendations:

- Let the infrastructure take care of container creation. For apps deployed with Azure DevOps pipelines, this means letting the pipeline take care of container creation.
- [Use a singleton client for all container access](https://learn.microsoft.com/en-us/azure/azure-functions/manage-connections?tabs=csharp#static-clients).

Setting up this singleton is usually done in `Startup.cs` as part of dependency container configuration. This part of the application is not async, and should be non-blocking.

There is no pipelines involved during development, and Azurite doesn't offer a feature to create containers at startup.

Our options are to either create the containers manually, which is a bottleneck during development testing; or to create mitigation code which complicates otherwise simple code.

It would have been nice to start azurite with an argument like `--containers "a, b, c"` to create three containers in this case, or `--auto-create-container=true`

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

blob

### Which version of the Azurite was used?

3.23.0

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

npm

### What's the Node.js version?

v18.12.1

### What problem was encountered?

Not able to preconfigure azurite with known containers.

### Steps to reproduce the issue?

### Have you found a mitigation/solution?

Write wrapping code around the container client which test for `"UseDevelopmentStorage=true"` at runtime, then create the container.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.