-
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
Allow for customization of the Azure ProvisioningContext + Better Azure resource name scheme #5809
Allow for customization of the Azure ProvisioningContext + Better Azure resource name scheme #5809
Conversation
Add IOptions<AzureProvisioningOptions> which contains a ProvisioningContext. Users can customize the ProvisioningContext by configuring the AzureProvisioningOptions like a typical IOptions.
Use a property on AzureConstructResource instead of flowing the ProvisioningContext through to the GetBicep methods.
@@ -55,8 +56,7 @@ public override BicepTemplateFile GetBicepTemplateFile(string? directory = null, | |||
var generationPath = Directory.CreateTempSubdirectory("aspire").FullName; | |||
var moduleSourcePath = Path.Combine(generationPath, "main.bicep"); | |||
|
|||
var provisioningContext = GetProvisioningContext(); | |||
var plan = resourceModuleConstruct.Build(provisioningContext); | |||
var plan = resourceModuleConstruct.Build(ProvisioningContext); |
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.
You still need a fallback if this isn't set.
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.
It allows null
.
It uses the context ??= ProvisioningContext.Provider.GetProvisioningContext();
.
@tg-msft - is that going to change at all with the changes to remove the DefaultInfrastructure you were mentioning?
This PR is now ready for review. |
Description
Add IOptions which contains a ProvisioningContext. Users can customize the ProvisioningContext by configuring the AzureProvisioningOptions like a typical IOptions.
This allows us to use the new CDK default naming scheme. Users can opt into the old scheme by customizing the ProvisioningContext.
Fix #5756
Fix #5341
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow