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.

Allow "startup commands"

See original GitHub issue

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

Blob.

Which version of the Azurite was used?

3.19.0

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

DockerHub

What’s the Node.js version?

In Docker image.

What problem was encountered?

When trying to set up Azurite for my app’s functional tests (app uses Azure blob storage), I need to have a few containers created in the storage. The real containers are typically created with Terraform on deployment, the app itself doesn’t create the containers.

It would make sense to be able to do a similar thing with Azurite: being able to have a basic “startup commands” feature where the user can list some pre-requisites and Azurite itself creates them.

Steps to reproduce the issue?

Run Azurite container and use the container thumbnails. The container doesn’t exists and I can’t make Azurite create it when starting up.

Have you found a mitigation/solution?

Two ways:

  1. the app can use its SDK and connection string to create the required containers, but since it otherwise expects them to be pre-existing, this feature would be built for tests only, messing up the application codebase with unrelated infrastructure code
  2. use an additional sideloaded container with a standalone SDK client (or az CLI tool) to run the commands, this is tricky to coordinate and quite convoluted overall, but seems like the direction which I’ll probably take

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
dkarlovicommented, Sep 5, 2022

Full example how to create storage containers with approach 2:

services:
    app:
        image: my/app:version
        depends_on:
            storage_init:
                condition: service_completed_successfully
    # Azure Blob Storage stuff here
    storage:
        image: mcr.microsoft.com/azure-storage/azurite:3.19.0
        # required, see https://github.com/Azure/Azurite/issues/1666
        healthcheck:
            test: nc 127.0.0.1 10000 -z
            interval: 1s
            retries: 30
    storage_init:
        image: mcr.microsoft.com/azure-cli:latest
        command:
            - /bin/sh
            - -c
            - |
                az storage container create --name version
        depends_on:
            storage:
                condition: service_healthy
        environment:
            # https://github.com/Azure/Azurite/blob/main/README.md#usage-with-azure-storage-sdks-or-tools
            AZURE_STORAGE_CONNECTION_STRING: DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://storage:10000/devstoreaccount1;
0reactions
bluewwcommented, Sep 23, 2022

@dkarlovi Thanks for the suggestion!

We will keep the issue open to track this request.

Azurite welcome contribution. It would be great if you have a good idea to implement this, and raise a PR to add this to Azurite.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac startup key combinations - Apple Support
Command (⌘)-R: Start up from the built-in macOS Recovery system. · Option (⌥) or Alt: Start up to Startup Manager, which allows you...
Read more >
Advanced startup options (including safe mode)
On the Advanced Boot Options screen, use the arrow keys to highlight the safe mode option you want, and then press Enter. Log...
Read more >
9 Ways to Access Advanced Startup/Boot Options Windows 10
Press Windows + R keys on the keyboard, and type cmd in Windows Run. Press Ctrl + Shift + Enter key to run...
Read more >
How to access Advanced Startup Options on Windows 11
Press and hold the Shift key and click the Restart button. Start menu power options. After you complete the steps, the action will...
Read more >
Windows Startup Settings Menu - Lifewire
The available options allow you to start Windows in some restricted fashion when it won't start normally. If Windows does start in the...
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