Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I quickly detect programmatically whether Azurite is running? #734

Closed
CAP-3Shape opened this issue Mar 25, 2021 · 4 comments
Closed

Comments

@CAP-3Shape
Copy link

I want to use Azurite to test my C# Azure application locally. In this issue, what I want to achieve is: Have my tests detect whether Azurite is running and abort quickly with a nice error message if it is not running. (By default, if the emulator is not running, the C# Azure library calls will time out after something like 30 seconds with an unclear error message.)

I am on Windows.

I have installed Azurite like this:

npm install -g azurite

I run it like this:

azurite --silent --location C:\temp\Azurite --debug c:\temp\Azurite\debug.log

I notice that the Azurite command-line application has no parameter that tells me whether it is already running. And when I start Azurite from the console I don't see any process or service in Task Explorer called anything like "azurite". So I don't know what process I'm supposed to check for.

I gather that Azurite is built on Node.js. There is indeed a process called node.exe running, but that's not a sufficient condition. Can I query my Node.js instance and get it to tell me whether it is running Azurite?

Thanks in advance!

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

Blob.

Which version of the Azurite was used?

3.11.0

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

NPM.

What's the Node.js version?

v15.4.0

@CAP-3Shape
Copy link
Author

@edwin-huber
Copy link
Collaborator

if you are in windows, you need to look for the command line used to start the node process.
you can do this using powershell:

$process = "node.exe"   
Get-WmiObject Win32_Process -Filter "name = '$process'" | Select-Object CommandLine | select-string azurite  

@edwin-huber
Copy link
Collaborator

You can also check this answer to get the list of running processes in nodejs https://stackoverflow.com/questions/13206724/how-to-get-the-list-of-process

@CAP-3Shape
Copy link
Author

Thanks. I have a few methods now. I will close the issue. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants