Restoring a SQL Server Database Backup using .NET Aspire #4390
-
I would like to update my WideWorldImporters sample application to Aspire: I think it could be a nice showcase for .NET Aspire, because it contains a Backend, Frontend and a non-trivial SQL Server database. And I want users to press F5 and experiment right away, instead of fiddling with Docker and all that. What I am unsure about is, what's the best way to download and restore the database backup, which can be obtained from the SQL Server Examples repositories (https://github.com/Microsoft/sql-server-samples/releases). When I wrote the I am currently downloading the Backup it in a # ...
RUN apt-get update \
&& ACCEPT_EULA=Y apt-get install mssql-tools18 unixodbc-dev -y \
&& wget -q https://github.com/Microsoft/sql-server-samples/releases/download/wide-world-importers-v1.0/WideWorldImporters-Full.bak
# ... And restore it using an SQL Script, which is called by the I saw the DatabaseContainers example looks strikingly similar: Are there any more pointers or best practices for restoring SQL Server Database Backups using Aspire? Or is it better to wait until Dockerfile support is available, which has been described in: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
We are adding support for building a container from a Dockerfile and running it. Once we have this you'll have a fairly concise way to inject scripty kinds of things like this into your application model. We would build a container image based on the sql tools image which includes your script, your script would download the database and restore it and then exit. |
Beta Was this translation helpful? Give feedback.
We are adding support for building a container from a Dockerfile and running it. Once we have this you'll have a fairly concise way to inject scripty kinds of things like this into your application model. We would build a container image based on the sql tools image which includes your script, your script would download the database and restore it and then exit.