Skip to content

Commit 07b37a0

Browse files
committed
React to changes on main.
1 parent b11dfb9 commit 07b37a0

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Azure.Provisioning.Expressions;
77
using Azure.Provisioning;
88
using System.Diagnostics.CodeAnalysis;
9+
using Aspire.Hosting.Azure;
910

1011
namespace Aspire.Hosting;
1112

@@ -20,12 +21,12 @@ public static class ContainerAppExtensions
2021
/// <param name="app">The container app resource to configure for custom domain usage.</param>
2122
/// <param name="customDomain">A resource builder for a parameter resource capturing the name of the custom domain.</param>
2223
/// <param name="certificateName">A resource builder for a parameter resource capturing the name of the certficate configured in the Azure Portal.</param>
23-
/// <exception cref="ArgumentException">Throws if the container app resource is not parented to a <see cref="ResourceModuleConstruct"/>.</exception>
24+
/// <exception cref="ArgumentException">Throws if the container app resource is not parented to a <see cref="AzureResourceInfrastructure"/>.</exception>
2425
/// <remarks>
2526
/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> extension method
2627
/// simplifies the process of assigning a custom domain to a container app resource when it is deployed. It has no impact on local development.</para>
2728
/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method is used
28-
/// in conjunction with the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{ResourceModuleConstruct, ContainerApp})"/>
29+
/// in conjunction with the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{AzureResourceInfrastructure, ContainerApp})"/>
2930
/// callback. Assigning a custom domain to a container app resource is a multi-step process and requires multiple deployments.</para>
3031
/// <para>The <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/> method takes
3132
/// two arguments which are parameter resource builders. The first is a parameter that represents the custom domain and the second is a parameter that
@@ -40,7 +41,7 @@ public static class ContainerAppExtensions
4041
/// <example>
4142
/// This example shows declaring two parameters to capture the custom domain and certificate name and
4243
/// passing them to the <see cref="ConfigureCustomDomain(ContainerApp, IResourceBuilder{ParameterResource}, IResourceBuilder{ParameterResource})"/>
43-
/// method via the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{ResourceModuleConstruct, ContainerApp})"/>
44+
/// method via the <see cref="AzureContainerAppContainerExtensions.PublishAsAzureContainerApp{T}(IResourceBuilder{T}, Action{AzureResourceInfrastructure, ContainerApp})"/>
4445
/// extension method.
4546
/// <code lang="C#">
4647
/// var builder = DistributedApplication.CreateBuilder();
@@ -56,7 +57,7 @@ public static class ContainerAppExtensions
5657
[Experimental("ASPIREACADOMAINS001", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")]
5758
public static void ConfigureCustomDomain(this ContainerApp app, IResourceBuilder<ParameterResource> customDomain, IResourceBuilder<ParameterResource> certificateName)
5859
{
59-
if (app.ParentInfrastructure is not ResourceModuleConstruct module)
60+
if (app.ParentInfrastructure is not AzureResourceInfrastructure module)
6061
{
6162
throw new ArgumentException("Cannot configure custom domain when resource is not parented by ResourceModuleConstruct.", nameof(app));
6263
}

src/Aspire.Hosting.Azure.AppContainers/PublicAPI.Unshipped.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Aspire.Hosting.Azure.AzureContainerAppCustomizationAnnotation.Configure.get -> S
55
Aspire.Hosting.AzureContainerAppContainerExtensions
66
Aspire.Hosting.AzureContainerAppExtensions
77
Aspire.Hosting.AzureContainerAppProjectExtensions
8+
Aspire.Hosting.ContainerAppExtensions
89
static Aspire.Hosting.AzureContainerAppContainerExtensions.PublishAsAzureContainerApp<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T!>! container, System.Action<Aspire.Hosting.Azure.AzureResourceInfrastructure!, Azure.Provisioning.AppContainers.ContainerApp!>! configure) -> Aspire.Hosting.ApplicationModel.IResourceBuilder<T!>!
910
static Aspire.Hosting.AzureContainerAppExtensions.AddAzureContainerAppsInfrastructure(this Aspire.Hosting.IDistributedApplicationBuilder! builder) -> Aspire.Hosting.IDistributedApplicationBuilder!
1011
static Aspire.Hosting.AzureContainerAppProjectExtensions.PublishAsAzureContainerApp<T>(this Aspire.Hosting.ApplicationModel.IResourceBuilder<T!>! project, System.Action<Aspire.Hosting.Azure.AzureResourceInfrastructure!, Azure.Provisioning.AppContainers.ContainerApp!>! configure) -> Aspire.Hosting.ApplicationModel.IResourceBuilder<T!>!

tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ public async Task ConfigureCustomDomainsMutatesIngress()
746746
var customDomain = builder.AddParameter("customDomain");
747747
var certificateName = builder.AddParameter("certificateName");
748748

749-
builder.AddContainerAppsInfrastructure();
749+
builder.AddAzureContainerAppsInfrastructure();
750750
builder.AddContainer("api", "myimage")
751751
.WithHttpEndpoint(targetPort: 1111)
752752
.PublishAsAzureContainerApp((module, c) =>
@@ -764,7 +764,7 @@ public async Task ConfigureCustomDomainsMutatesIngress()
764764

765765
container.TryGetLastAnnotation<DeploymentTargetAnnotation>(out var target);
766766

767-
var resource = target?.DeploymentTarget as AzureConstructResource;
767+
var resource = target?.DeploymentTarget as AzureBicepResource;
768768

769769
Assert.NotNull(resource);
770770

0 commit comments

Comments
 (0)