Reputation: 167
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:
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
Reputation: 167
The following steps resolved my issue:
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
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"
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
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"
Upvotes: 6
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