6

I'm trying to run Azure Function locally using Visual Studio and doing timed trigger, and I have set this in local.settings.json

"AzureWebJobsStorage": "UseDevelopmentStorage=true",

But when I run it, it has an error "Invalid storage account 'devstoreaccount1'.

I try to start the emulator (admin, turned off firewall), it has this error. Default install, no modifications.

C:\Windows\system32>cd C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.2.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb52 on SQL instance '(localdb)\MSSQLLocalDB'.

Granting database access to user Robin-PC\Robin.
Database access for user Robin-PC\Robin was granted.

Initialization successful. The storage emulator is now ready for use.
The storage emulator was successfully initialized and is ready to use.

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe start
Windows Azure Storage Emulator 5.2.0.0 command line tool

Unhandled Exception: System.TimeoutException: Unable to open wait handle.
   at Microsoft.WindowsAzure.Storage.Emulator.Controller.EmulatorProcessController.InternalWaitForStorageEmulator(Int32 timeoutInMilliseconds)
   at Microsoft.WindowsAzure.Storage.Emulator.Controller.EmulatorProcessController.EnsureRunning(Int32 timeoutInMilliseconds)
   at Microsoft.WindowsAzure.Storage.Emulator.Commands.StartCommand.RunCommand()
   at Microsoft.WindowsAzure.Storage.Emulator.Program.Main(String[] args)

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>
Robin
  • 451
  • 3
  • 14
  • Just had this same issue and this command helped me: `netsh http add iplisten 127.0.0.1` for ref https://github.com/Azure/azure-storage-net/issues/370 – Ariel Popovsky Jun 16 '22 at 18:18

3 Answers3

5

After many tries, I managed to find out why. The default 10000 port is taken by a background process. I followed this instruction to find out which process and killed it, then it will work.

https://stackoverflow.com/a/43787993/283598

Robin
  • 451
  • 3
  • 14
0

In my case I had spun up the newer Azurite storage emulator, which used the same port number.

Terminating that storage emulator allowed me to start the (deprecated) Windows Azure Storage emulator.

Ciaran Gallagher
  • 3,895
  • 9
  • 53
  • 97
-1

I have this same issue, how i solved that issue is given below

  1. open command prombt as admin and change directory to C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator
  2. Run command "AzureStorageEmulator.exe start -inprocess "

This worked for me

Sarath Baiju
  • 226
  • 2
  • 9