Search code examples
visual-studioazure-functionsazure-storage-emulator

Can not start the Azure Storage Emulator


I am creating my first azure function on VS 2019. When I try to run, it comes with this error:

error message image

I am using OS win 10. And the version of my VS is 16.4.29728.190. What kind of role does the Storage Emulator play in the azure function? Why am I encountering this problem, is it that I haven't configured the azure function? How to fix it?


Solution

  • Update:

    Updating the answer, I found that the more common situation is port occupation. If you encounter this problem, you can query the usage of port 10000 and then kill the process occupying the port.

    First, search:

    netstat -p tcp -ano | findstr :10000
    

    Then, kill:

    taskkill /T /F /PID yourPID
    

    There is also a rare case in which you can avoid the problem by simply crossing off the error window.

    Original Answer:

    The problem you encountered is accidental. It has nothing to do with the function configuration. The problem is that the related component has a problem. Reinstalling it can solve the problem.

    It ’s not a difficult issue to troubleshoot, it ’s just a bit frustrating that it happens in the first place.

    1, Obviously, you first need to ensure that the Azure Storage Emulator is installed on your machine. This is part of the Azure SDK, so you should be OK if you've installed that. However, you can install the emulator as a stand -alone app. To check if it is installed on your machine, click on Windows Start and type “Azure Storage Emulator”.

    2, If the application is displayed in your Start menu, you can go ahead and run it manually. This will invoke a console window that will inform you of the emulator being ready to be used.

    3.If the application is not displayed in your Start menu, either install the full Azure SDK or the stand-alone Azure Storage Emulator app, as explained earlier.

    4, For more information, navigate to Microsoft ’s docs here.