Aspire.Hosting.Azure.Sql - Deployment of Database Project not working
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
When using RunAsContainer with SQL Database projects hosting extension, events do not seem to be respected.
```csharp
var sqlSrv = builder.AddAzureSqlServer("sql")
.RunAsContainer();
var sqlDb = sqlSrv.AddDatabase("aspiretodo");
var dbPrj = builder.AddSqlProject("tododb")
.WithReference(sqlDb);
```
this code in the SQL database projects extension runs without any waiting:
```
builder.ApplicationBuilder.Eventing.Subscribe(async (@event, ct) => {
await RunPublish(builder, target, targetDatabaseName, @event.Services, ct);
});
```
If the RunAsContainer method was updated for eventing, I think this would work out of the box with the current implementation
See discussion in the issue here: https://github.com/CommunityToolkit/Aspire/issues/529#issuecomment-2748805879
### Expected Behavior
The RunAsContainer method should fire ResourcesCreatedEvent when running.
### Steps To Reproduce
_No response_
### Exceptions (if any)
_No response_
### .NET Version info
.NET 8
### Anything else?
```xml
```
Contributor guide
Assessment
This issue has not been assessed yet.