When I start development storage emulator, I get an error
The process cannot access the file because it is being used by another process
I guess th
I had the same issue, but in my case, the problem was somewhere else. There was the process System (PID 4) listening on the port 10,000, so it's obvious I wasn't able to kill such process. The only workaround was to reboot Windows (Windows 7 64-bit), but that's too extreme and time consuming.
The most challenging part was to identify, why is the System process listening on that port. Google didn't help at all in this case.
So I simply tried to connect to the port 10,000 on localhost using Netcat (better Telnet) and send there something:
$ nc 127.0.0.1 10000
I quickly noticed from the response, that there is an HTTP server listening on the port 10,000. The most important information in the response was this header:
Server: Microsoft-HTTPAPI/2.0
Then it was really fast to free this port for Azure Emulator. Brief googling revealed the details about what is this thing actually doing: HTTP Server API, and most importantly who is it doing: Windows HTTP Services.
Then I went to Services Management Console, found the service called Service WinHTTP WPAD which was running and simply stopped it. And voila, the port 10,000 is free as a bird now.
Does anyone know how does it work? I guess that some 3rd application creates a listening HTTP server on the port 10,000 using the WinHTTP WPAD service. I doubt that it's anything from Microsoft since they wouldn't configure the Azure Emulator to use the port already used by them.
This might be another process using the port that Azure dev storage is using.
To figure out which app is that, run netstat
first:
netstat -p tcp -ano | findstr :10000
You will get a process id (PID) in the last column:
TCP 0.0.0.0:10000 0.0.0.0:0 LISTENING 2204
It means that process listening to this port is ID 2204. Then run taklist
:
tasklist /fi "pid eq 2204"
So you will see something like this:
Image Name PID Session Name Session# Mem Usage
========================= ======== ================ =========== ============
SMSvcHost.exe 2204 Services 0 29 300 K
So now you know that SMSvcHost.exe
is listening on that port.
If you can't stop the process using the port, there's a way to remap the ports used by DevFabric. The solution is taken from this blog post:
You could do that by navigating to C:\Program Files\Windows Azure SDK\v1.4\bin\devstore (replace 1.4 with your SDK version) and opening DSService.exe.config. From there you could change the configuration and make your services listen to other ports.
For me in v1.6 the path was C:\Program Files\Windows Azure Emulator\emulator\devstore\DSService.exe.config
For SDK v2.5 / Storage v3.4 the path is %ProgramFiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\WAStorageEmulator.exe.config
For Emulator v4+ the path is %ProgramFiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.config
But be careful, because you will not be able to use UseDevelopmentStorage=true
in your connection string anymore (e.g. connect with Azure Storage Explorer).
DsInit
doesn't helpIn order to connect, use a custom connection string that is targeting the new endpoint ports you defined. You'll still want to connect using the standard, well-known storage emulator account name and key. An example connection string can be found here.
In my case, there was no bit Torrent on my system. However, the port 1000 was being used by some java.exe. I figured out that running HDInsight locally doesn't work with Azure blob storage. So I went to Azure Storage Emulater UI and unchecked the blob. After that this issue got resolved.
Stop BitTorrent. In my experience, this error is usually a port conflict, and BitTorrent does typically grab port 10000. If it's not BitTorrent, look for other apps that might be holding on to port 10000. Netstat can probably help.