Azure Storage Emulator fails to init with "The database 'AzureStorageEmulatorDb57' does not exist"

Murray Foxcroft picture Murray Foxcroft · Dec 7, 2018 · Viewed 7.2k times · Source

I am having an issue with Azure Storage Emulator. I tried to re-initialise the database and got the error below.

This was after installing Visual Studio 2019 Preview but this may just be a co-incidence. I tried for an hour or so to get it running and then gave up and just reset my machine with the "keep my files" option, re-installed Visual Studio 2017 and the Azure Tools but still see the same problem.

I know a reset sounds a bit drastic but VS 2019 broke my Azure Functions in VS2017, they would not launch so I wanted a clean install.

If I manually create the DB with sqllocaldb create (version 13.1.4001.0), the DB gets created fine but the init still fails with the same message.

Any ideas?

C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init Windows Azure Storage Emulator 5.7.0.0 command line tool Found SQL Instance (localdb)\MSSQLLocalDB. Creating database AzureStorageEmulatorDb57 on SQL instance '(localdb)\MSSQLLocalDB'. Cannot create database 'AzureStorageEmulatorDb57' : The database 'AzureStorageEmulatorDb57' does not exist. Supply a valid database name. To see available databases, use sys.databases.. One or more initialization actions have failed. Resolve these errors before attempting to run the storage emulator again. Error: Cannot create database 'AzureStorageEmulatorDb57' : The database 'AzureStorageEmulatorDb57' does not exist. Supply a valid database name. To see available databases, use sys.databases..

Answer

Bill picture Bill · Dec 28, 2018
  1. Stop the Azure Emulator if it is running.
  2. Open SSMS and connect to your (localdb) instance.
  3. Manually create the "AzureStorageEmulatorDb57".
  4. Open a command prompt as Administrator.
  5. Run the "AzureStorageEmulator.exe init".
  6. Run your VS project.