Reputation: 13
I am creating my first azure function on VS 2019. When I try to run, it comes with this error:
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?
Upvotes: 1
Views: 5636
Reputation: 33
There was no process occupying the port '10000' in my case. Found a solution in the link and modifying the port to '20000' (see img) in the config file at path C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe.config worked for me.
Upvotes: 2
Reputation: 1
Answer from Cindy helped to some extent, I my case I had to create database manually as was getting error message on database creation failed when I was starting storage Emulator manually from start menu.
Once database was created, storage emulator started smoothly and there was no need to start emulator manually before running the function from VS 2019.
Upvotes: 0
Reputation: 14103
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.
Upvotes: 8
Reputation: 176
If you are starting this along with VS 2019 debugger, you have to start VS 2019 in Administrator mode. Otherwise first start the storage emulator separately before starting debugger.
Upvotes: 0