-
Notifications
You must be signed in to change notification settings - Fork 496
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
Update Azure Sql to use new API pattern #6094
Conversation
We are moving to a new API pattern for Azure resources that can also be used locally as a container.Update Azure Sql Server to follow the same pattern. * The existing [Publish]AsAzureSqlDatabase methods are marked Obsolete * New AddAzureSqlServer method is introduced for when you want an Azure resource. * To use a non-Azure container locally, a new RunAsContainer method is added. Fix dotnet#5998
Aspire.Hosting.Azure.AzureSqlDatabaseResource.Parent.get -> Aspire.Hosting.Azure.AzureSqlServerResource! | ||
Aspire.Hosting.Azure.AzureSqlServerResource.AzureSqlServerResource(string! name, System.Action<Aspire.Hosting.ResourceModuleConstruct!>! configureConstruct) -> void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mitchdenny @davidfowl - the nominclature here is really hard. Is this what we want?
AzureSqlServerResource
(existing) - The "Server" resourceAzureSqlDatabaseResource
(new) - The child "database" resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The official service names don't help much :) I think AzureSqlDatabaseResource and AzureSqlServerResource is probably the best option.
[Experimental("AZPROVISION001", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")] | ||
public static IResourceBuilder<SqlServerServerResource> AsAzureSqlDatabase(this IResourceBuilder<SqlServerServerResource> builder, Action<IResourceBuilder<AzureSqlServerResource>, ResourceModuleConstruct, SqlServer, IEnumerable<SqlDatabase>>? configureResource) | ||
{ | ||
return builder.PublishAsAzureSqlDatabase(configureResource, useProvisioner: true); | ||
} | ||
|
||
/// <summary> | ||
/// Adds an Azure SQL Database (server) resource to the application model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the nominclature gets worse. Azure SQL Database
is the name of the service (AFAICT). So this is the Azure SQL Database "server" resource.
I was following existing XML docs above here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think colloquially people call Azure SQL Database ... Azure SQL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... to finish that thought. I think then it is fine to do AddAzureSqlServer(...) because effectively that is what you are doing ... creating a server resource. On the backend I seem to remember that Azure SQL Database Servers were somehow a virtual concept but things could have changed.
Description
We are moving to a new API pattern for Azure resources that can also be used locally as a container.Update Azure Sql Server to follow the same pattern.
Fix #5998
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow