windows azure development storage blob service not starting

前端 未结 4 1194
孤城傲影
孤城傲影 2021-02-07 04:26

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

4条回答
  •  萌比男神i
    2021-02-07 05:15

    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 help
    • Specifying the connection string this way https://stackoverflow.com/a/7037036/182371 doesn't help either.

    In 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.

提交回复
热议问题