Docker SQL无法从Azure Storage Emulator对用户进行身份验证



我在本地机器上使用这个设置docker文件:

docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=some_pwd" -e "MSSQL_PID=Express" -p 1433:1433 -d --restart=always mcr.microsoft.com/mssql/server:2019-latest

我试着通过SSMS从我的本地机器连接,它起作用了。但是,当我运行Azure Storage Emulator(init或start命令(时,会失败

错误:找不到可用的SQL实例。

同时,这会发生在容器的docker日志中:

用户"sql1\Guest"登录失败。原因:找不到与提供的名称匹配的登录名。[客户:XXX.XXX.XXX.xxxx]

Docker、SSMS和Azure Storage Emulator在同一台本地计算机上运行。

初始化Azure Storage Emulator时,需要指定要连接的数据库。它在您的机器中寻找SQL实例,而不是在docker容器中。

AzureStorageEmulator.exe init [-server serverName] [-sqlinstance instanceName] [-forcecreate|-skipcreate] [-reserveports|-unreserveports] [-inprocess]

https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#initialize-存储-模拟器-差异-sql数据库

https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#storage-模拟器命令行工具参考

相关内容

最新更新