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.
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#initialize-the-storage-emulator-to-use-a-different-sql-database
https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator#storage-emulator-command-line-tool-reference