简体   繁体   中英

Docker SQL failing to authenticate the user from Azure Storage Emulator

I set up docker file using this on my local machine:

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

I tried connecting from my local machine via SSMS and it works. However, when I run Azure Storage Emulator (either init, or start command) it fails with

Error: No available SQL Instance was found.

At the same time this occurs in docker logs for the container:

Login failed for user 'sql1\Guest'. Reason: Could not find a login matching the name provided. [CLIENT: XXX.XXX.XXX.XXX]

Docker, SSMS and Azure Storage Emulator are running on the same local machine.

When initializing the Azure Storage Emulator, you need to specify the database you want to connect. It's looking for a SQL instance in your machine, not inside docker containers.

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

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#initialize-the-storage-emulator-to-use-a-different-sql-database

https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#storage-emulator-command-line-tool-reference

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM