3
votes

I've upgraded Azure Storage Emulator from 2.3 to 2.4. WAStorageEmulator.exe has been renamed to AzureStorageEmulator.exe but that's not the issue.

When I run

AzureStorageEmulator init -forcecreate

I simply get an error that Google returns with zero results:

Error: User-specified instance not found. Please correct this and re-run initial ization.

Edit

I had to do a start and stop and then I was able to init. Because I had previous version of emulator installed I already have WAStorageEmulatorDb34 on my local SQL server instance. After I run init command I can see that no new database is being created (like WAStorageEmulatorDb42).

So I thought that the newest version may be using older DB. I then ran a query in MSSMS to check for existing blob containers and I can still see both containers I created on the older emulator containing blobs I added.

When I then accessed Development Azure Storage in Visual Studio it showed no containers whatsoever. So the new version apparently doesn't use old DB. But which one? And where is it?

Ok so I thought I'd run init one more time but with additional parameters to put DB on my SQL server instance:

AzureStorageEmulator init -server localhost -sqlinstance MSSQLSERVER -forcecreate

And then I get the aforementioned error. Again...

I'm running CMD as admin with elevated permissions.

2
Try "/forceCreate" instead of "-forceCreate" AzureStorageEmulator init /forceCreateFabrizio Accatino
@FabrizioAccatino I had to do a start and stop and then I was able to run init... Regardless of using minus or slash... BUT. My preexisting DB WAStorageEmulator34 is still there, but no new database is being created? This existing DB has two containers, but when I access Storage Emulator from within VS I see nothing as one would expect when initialization with -forcecreate would reinitialize DB. So I wonder which database is this latest emulator using and where is it?Robert Koritnik
@FabrizioAccatino: See my edited questionRobert Koritnik
AFAIK db files are not compatible across different version of Storage Emulator. I had emulator 4.1 and now 4.2. Under c:\users\fabry\ I see two localdb files: AzureStorageEmulatorDb41.mdf and AzureStorageEmulatorDb42.mdf I know that everytime I update the storage-emulator, I start with an emtpy repository.Fabrizio Accatino

2 Answers

11
votes

Solution that eventually worked

Additional info

Azure Storage Emulator normally creates tables in the LocalDB storage. Depending on the emulator version these may be in various DB instances. You can check each storage emulator version's configuration in

%USERPROFILE%\AppData\Local\[AzureStorageEmulatorFolder]\*.config

Different versions have different folder names from DevelopmentStorage, WAStorageEmulator to latest (4.2) AzureStorageEmulator.

In this subfolder you'll find at least one config file that will correspond to your installed Azure storage emulator's version. If you open it, you'll see how it's configured and where it saved its tables. This is also true if you create initialization on any existing full SQL server instance.

The problem when I was trying to initialize my Azure Storage Emulator (ASE) is that I was also providing SQL server's instance which is the default one (MSSQLSERVER). I shouldn't be providing this information in the first place but only provide information about server

So the correct command line call is

AzureStorageEmulator init -server localhost -forcecreate

This created my database on my local SQL server. From here on, it's up to you how you'll migrate from an existing ASE database (if you already had one before) to the new one.

0
votes

The issue I ran into is more or less an user error.

Azure Storage Emulator 4.6

Error : User-specified instance not found. Please correct this and re-run initialization.

and

Resolution : I didn't have a windows authenticated login to my local sql instance.