This is mostly just the result of some searching, troubleshooting and setup for Docker, AdventureWorks, and Azure Data Studio on macOS.
Get the AdventureWorks Sample Database, and save it somewhere. In this case, we save AdventureWorks2022.bak
to the Desktop for use in a later step.
Use docker pull
to download the Azure SQL Edge container image
docker pull mcr.microsoft.com/azure-sql-edge:latest
Run a container using the Azure SQL Edge container image with some parameters:
docker run -d --name SQLEdge -p 6666:1433 -e "ACCEPT_EULA=Y" -e "MSSQL_SA_PASSWORD=w0nD3rFuuull" -e "MSSQL_PID=Developer" mcr.microsoft.com/azure-sql-edge
Create directory and copy the .bak file:
docker exec -it SQLEdge mkdir "/var/opt/mssql/backup"
docker cp ~/Desktop/AdventureWorks2022.bak SQLEdge:/var/opt/mssql/backup/
Then restore
RESTORE DATABASE AdventureWorks2022 FROM DISK = '/var/opt/mssql/backup/AdventureWorks2022.bak' WITH REPLACE, RECOVERY, MOVE 'AdventureWorks2022' TO '/var/opt/mssql/data/aw2022.mdf', MOVE 'AdventureWorks2022_log' TO '/var/opt/mssql/data/aw2022.ldf';