Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 325 forks source link

Is there another way to close the Azurite Emulator other than using "Ctrl + C" directly in command line #1139

Open Universe07 opened 3 years ago

Universe07 commented 3 years ago

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

All of four services

Which version of the Azurite was used?

3.14.3

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

npm

What's the Node.js version?

v16.13.0

What problem was encountered?

Steps to reproduce the issue?

If possible, please provide the debug log using the -d parameter, replacing \<pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:

-d "<pathtodebuglog>"

I'd like to clarify my intention. Currently, we are migrating from Azure Storage Emulator to Azurite Emulator. Before, on Azure Storage Emulator, it has several options for command-line.

Command-line syntax

AzureStorageEmulator.exe [start] [stop] [status] [clear] [init] [help]

I was wondering is there any option for npm Azurite like "azurite close" to stop it from working.

Thanks in advance for your help.

Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.

Have you found a mitigation/solution?

blueww commented 3 years ago

@Universe07
Azurite (installed with npm) currently can only be stop by send Ctrl+c.

One workaround is using some process manage tools like pm2. On my machine, following command works well to start and stop Azurite:

pm2 start C:\Users\[UserName]\AppData\Roaming\npm\node_modules\azurite\dist\src\azurite.js  
pm2 stop azurite  

BTW, It's better not kill Azurite, since it might cause some data not persist. (However, if you don't care persist data, you can try to kill it.)

edwin-huber commented 3 years ago

If you have it as part of a test run or CI/CD pipeline, you can look in the /tests folders to see how we start Azurite

    server = createTableServerForTestHttps();
    await server.start();

and then stop it again.

    await server.close();
stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.