4

我正在设置开发人员映像 Azure。

我安装了最新的 Azure Storage Emulator (v5.3),然后安装了 SQL Server 2017。

Azure 存储模拟器无法创建数据库。以下是日志:

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>sqllocaldb i
MSSQLLocalDB

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>AzureStorageEmulator.exe init
Windows Azure Storage Emulator 5.3.0.0 command line tool
Found SQL Instance (localdb)\MSSQLLocalDB.
Creating database AzureStorageEmulatorDb53 on SQL instance '(localdb)\MSSQLLocalDB'.
Cannot create database 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' 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 'AzureStorageEmulatorDb53' : The database 'AzureStorageEmulatorDb53' does not exist. Supply a valid database name. To see available databases, use sys.databases..

c:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator>sqllocaldb v
Microsoft SQL Server 2017 (14.0.1000.169)

模拟器 v5.3 是否不适用于服务器 2017?

4

2 回答 2

1

这有效(注意powershell):

Invoke-WebRequest https://download.microsoft.com/download/9/0/7/907AD35F-9F9C-43A5-9789-52470555DB90/ENU/SqlLocalDB.msi -OutFile SqlLocalDB.msi

msiexec /i SqlLocalDB.msi /qn /norestart IACCEPTSQLLOCALDBLICENSETERMS=YES

Invoke-WebRequest http://download.microsoft.com/download/1/F/C/1FCF23A3-BBD8-4F50-B5C2-E382F14A2AAD/MicrosoftAzureStorageEmulator.msi -OutFile MicrosoftAzureStorageEmulator.msi

msiexec /i MicrosoftAzureStorageEmulator.msi /qn

Remove-Item -Force *.msi

setx /M AZ_STOR_EMU_HOME "%ProgramFiles(x86)%\Microsoft SDKs\Azure\Storage Emulator"

setx /M PATH "%PATH%;%AZ_STOR_EMU_HOME%"

cd "C:\Program Files (x86)\Microsoft SDKs\Azure\Storage Emulator"

Start-Process -FilePath "AzureStorageEmulator.exe" -ArgumentList "init"

上述脚本将使用 Microsoft SQL Server 2016 LocalDB 和 Microsoft Azure Storage Emulator v5.3。现在模拟器正确初始化。

我从这里找到的 dockerfile 中选择了这个。

于 2018-04-25T17:34:29.980 回答
1

强制在 localhost 上创建数据库:

开始 -> Microsoft Azure 存储命令行

cd "Storage Emulator"
AzureStorageEmulator init -sqlinstance . -forcecreate
AzureStorageEmulator start
于 2019-01-27T09:48:56.133 回答