Skip to content
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

[release/9.0] Experimental custom domain support for ACA. #6391

Merged
merged 4 commits into from
Oct 23, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 21, 2024

Backport of #6275 to release/9.0

/cc @mitchdenny

Customer Impact

If a customer upgrades to .NET Aspire 9.0 and makes use of PublishAsAzureContainerApp then azd will no longer preserve custom domains. This PR adds an experimental API that returns this capability which would unblock their adoption of .NET Aspire 9.0.

Testing

Tested locally with AZD as well as unit tests to verify that valid Bicep is produced.

Risk

Low risk. Only comes into play when the ConfigureCustomDomains(...) extension is used and does not influence any code paths unless it is used.

Regression?

No.

Microsoft Reviewers: Open in CodeFlow

@joperezr
Copy link
Member

This one does make me a bit nervous as it is essentially adding a new feature as well here (while being added as experimental). Help me understand the impact and risk a bit more, How likely is it for someone to hit this regression and how confident are we with the fix in terms of risk? Also, is this fallout of the onboard to the new Azure.Provisioning?

@davidfowl
Copy link
Member

Risk is very low here, it's an additional API that isn't used by default and that customers will likely use instead of the code they were hacking together manually editing bicep in v8.

@mitchdenny
Copy link
Member

The reason we had to do this was that in .NET Aspire 8.0 we achieved custom domain support by having a feature flag in azd which first read the domain configuration for a container app from the ACA RP and then merged it with the deployment that it was doing. When people use PublishAsAzureContainerApp that behavior doesn't come into play.

If we don't ship this in 9.0, folks who want to customize their container apps (e.g. scale to zero) cannot use a custom domain because subsequent deployments would remove that binding and take their site offline.

They could work around it by pasting in the blob of Azure Provisioning code - but that ultimately is what this extension method does. If they don't use the extension method there is literally zero impact because all it does is add some additional Bicep properties (if it is called).

@joperezr
Copy link
Member

Got it, thanks for the explanation Mitch. This is approved for 9.0. One last question though, what is the plan for this long term? Is it to use this API and just remove the experimental attribute? If so, any idea when?

@joperezr
Copy link
Member

@mitchdenny is this ready to go? If so I can merge.

@mitchdenny
Copy link
Member

It's ready

@joperezr joperezr merged commit 8b88522 into release/9.0 Oct 23, 2024
8 checks passed
@joperezr joperezr deleted the backport/pr-6275-to-release/9.0 branch October 23, 2024 20:26
/// <summary>
/// Provides extension methods for customizing Azure Container App resource.
/// </summary>
public static class ContainerAppExtensions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Why is this in a new class?
  2. Why does this new class not follow the naming conventions in the rest of the library?

I think this method should go in the existing AzureContainerAppExtensions class.

cc @mitchdenny @davidfowl

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was intentionally named I think because @mitchdenny was thinking it would eventually be a cdk method. But not sure

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class named to match the type name.

joperezr added a commit to joperezr/aspire that referenced this pull request Nov 13, 2024
#### AI description  (iteration 1)
#### PR Classification
Merge branch `release/9.0` into `internal/release/9.0` to integrate recent changes and address specific work items.

#### PR Summary
This pull request integrates changes from the `release/9.0` branch into `internal/release/9.0`, addressing several work items related to Azure storage and network isolation.
- `/tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs`: Added a new test `ConfigureCustomDomainsMutatesIngress` to validate custom domain configuration for Azure Container Apps.
- `/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs`: Introduced a new extension method `ConfigureCustomDomain` to simplify the process of assigning custom domains to Azure Container Apps.

Related work items: dotnet#6368, dotnet#6391, dotnet#6433, dotnet#6458, dotnet#6467
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants