Eduwow
Eduwow

Reputation: 167

Azurite Error: "Exit Due to Unhandled Error" when Running Azure Function Project

Good day fellow developer,

I would like to ask for help regarding running my Azure Function project using Visual Studio 2022.

Here's what happened, just after our Visual Studio 2022 was updated by our IT admin, we can no longer run our Azure Function project. When running the command: "C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe" we encounter the following error: "Exit due to unhandled error: listen EADDRINUSE: address already in use 127.0.0.1:10001". See screenshot below:enter image description here

I have already tried some solutions listed in this link Azure Storage Emulator error and does not start, but we can't try the solutions that involve running CMD as an "Administrator" since our IT admin is the only one with access.

Upvotes: 1

Views: 3441

Answers (3)

Eduwow
Eduwow

Reputation: 167

The following steps resolved my issue:

  1. Create a local storage accounts from Microsoft Azure Storage Explorer application. Customized the ports of the following: Blobs, Queues, and Table. See sample below:

enter image description here

  1. Initialize the ports for the newly created storage accounts.

    C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe" --blobPort 20000 --queuePort 20001 --tablePort 20002 --silent --location c:\azurite --debug c:\azurite\debug.log

see reference: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azurite?tabs=visual-studio%2Cblob-storage

Upvotes: 0

Pravallika KV
Pravallika KV

Reputation: 8714

The reason of this error is there could be an instance running in the same port and if the new process tries to use the same port it leads to this error.

Initially, I got the same error when trying to run Azurite in the command prompt:

"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe"

enter image description here

Resolution: I ran below commands to kill the process which is using the 10000.

1. netstat -ano | findstr :10000

2. taskkill /PID <process_id> /F

enter image description here

I could run Azurite now with the command:

"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\Microsoft\Azure Storage Emulator\azurite.exe"

enter image description here

Upvotes: 6

To&#224;n Đo&#224;n
To&#224;n Đo&#224;n

Reputation: 487

I haven’t used Azurite, and this may be a bit stupid, but I think the error happens because Azurite Queue service is running on the same port of something else, as stated in the log. Maybe you can try changing the port/address for this service to another one?

Upvotes: 0

Related Questions