You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an sql server set up in Apphost project with a database.
I have created custom commands: one for publishing a dacpac to the database and another one that allows you to restore the database from the test environment to your local machine.
The test enviroment's database backs up every night in an Azure Blob Container so the command that restores the database does one of the following:
If there is not a .bak file present in a predefined location, the database is restored directly from the Blob Container by RESTORE DATABASE FROM URL query
If there is a .bak file present then that file is used instead and the database is restored using RESTORE DATABASE FROM DISK query
The 1st scenario works fine, but the 2nd does not since I need to copy the .bak file (~13GB) to the docker container and AFAIK I need the container ID for doing this.
I can get the container image name by using builder.Resource.Parent.TryGetContainerImageName() Where the builder.Resource is the database resource.
I know that Aspire dashboard has the ID as is pictured below, so how can I read this within the apphost code?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have an sql server set up in Apphost project with a database.
I have created custom commands: one for publishing a dacpac to the database and another one that allows you to restore the database from the test environment to your local machine.
The test enviroment's database backs up every night in an Azure Blob Container so the command that restores the database does one of the following:
The 1st scenario works fine, but the 2nd does not since I need to copy the .bak file (~13GB) to the docker container and AFAIK I need the container ID for doing this.
I can get the container image name by using
builder.Resource.Parent.TryGetContainerImageName()
Where thebuilder.Resource
is the database resource.I know that Aspire dashboard has the ID as is pictured below, so how can I read this within the apphost code?

Beta Was this translation helpful? Give feedback.
All reactions