-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deployment stuck in "Pending" state when using Aspire.Hosting.Azure.Sql #529
Comments
Related to #434 I believe |
@yorek What happens if you remove usage of SQL Projects? Can you share a dashboard screen shot? @aaronpowell Yes, sounds related to #434 |
That looks like a good catch. I wonder how we can best tackle it, do we create a separate |
What is the difference between builder.AddAzureSqlServer("sql") And .AddSqlServer Is it deployment support or anything else? |
@aaronpowell If you use Microsoft.Data.SqlClient you end up with a lot of Azure "stuff" anyway currently. |
It was local deployment: https://github.com/dotnet/aspire/blob/main/src/Aspire.Hosting.Azure.Sql/AzureSqlExtensions.cs#L167 |
What if the Resource classes here were in a seperate package? https://github.com/dotnet/aspire/tree/main/src/Aspire.Hosting.Azure.Sql |
Thinking through this, the question, in my mind, is "what happens if it's an Azure SQL resource?", as in, not configured to be a container locally, just purely an Azure SQL resource - should (can?) it deploy to Azure SQL? Since the SqlDatabaseProjects package doesn't produce anything in the manifest, it means we have to be careful on how the support works. Take this code for example: var sqlSrv = builder.AddAzureSqlServer("sql");
var sqlDb = sqlSrv.AddDatabase("aspiretodo");
var dbPrj = builder.AddSqlProject<Projects.TodoDB>("tododb")
.WithReference(sqlDb)
.WaitFor(sqlDb); What happens when you use Aspire to deploy? Well, the So back to the problem at hand, I think this works (I haven't tested): var dbPrj = builder.AddSqlProject<Projects.TodoDB>("tododb");
var sqlSrv = builder.AddAzureSqlServer("sql")
.RunAsContainer(resource => {
// find databases from the resource, or maybe via the builder
});
var sqlDb = sqlSrv.AddDatabase("aspiretodo"); The callback provided to |
Hey both, from my understanding the |
I think it should, right? Conceptually it would be equivalent to run EF Core migrations against Azure SQL instead of SQL Server and that is expected to work right away |
Yep, I'd expect so (I'm just unfamiliar with the tooling that powers the integration). Deployment is more complex though, as you need to run the dacpac deployment as part of the Bicep files, which I guess you'd do as a custom script in Bicep, but you'd need to somehow upload the dacpac to somewhere that it can be downloaded in the script run. This is why it's not currently enabled for deployment - deployment makes it complex. |
Yeah, I dug into the source - since there is no "Azure SQL Container" it spins up a plain SQL Server 2022 container...
Yeah, exactly! And I absolutely agree that this is a noble end goal! I am not an expert, but maybe the following options are worth investigating:
|
Describe the bug
When using
AddAzureSqlServer("").RunAscontainer()
using theAspire.Hosting.Azure.Sql
package, the deployment just hangs. No error, no logs...just hanging, and deployment reports "Pending" as a status.Regression
No response
Steps to reproduce
Expected behavior
Deploy the database project
Screenshots
No response
IDE and version
Other
IDE version
VS Code
Nuget packages
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item
The text was updated successfully, but these errors were encountered: