From 70bf98db2c21669ef2b2cac353ea89cce9b740be Mon Sep 17 00:00:00 2001 From: Mitch Denny Date: Fri, 18 Oct 2024 14:33:45 +1100 Subject: [PATCH] React to changes on main. --- .../ContainerAppExtensions.cs | 9 +++++---- .../PublicAPI.Unshipped.txt | 1 + .../AzureContainerAppsTests.cs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs b/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs index 5f8ba0138bd..f1f004d121b 100644 --- a/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs +++ b/src/Aspire.Hosting.Azure.AppContainers/ContainerAppExtensions.cs @@ -6,6 +6,7 @@ using Azure.Provisioning.Expressions; using Azure.Provisioning; using System.Diagnostics.CodeAnalysis; +using Aspire.Hosting.Azure; namespace Aspire.Hosting; @@ -20,12 +21,12 @@ public static class ContainerAppExtensions /// The container app resource to configure for custom domain usage. /// A resource builder for a parameter resource capturing the name of the custom domain. /// A resource builder for a parameter resource capturing the name of the certficate configured in the Azure Portal. - /// Throws if the container app resource is not parented to a . + /// Throws if the container app resource is not parented to a . /// /// The extension method /// simplifies the process of assigning a custom domain to a container app resource when it is deployed. It has no impact on local development. /// The method is used - /// in conjunction with the + /// in conjunction with the /// callback. Assigning a custom domain to a container app resource is a multi-step process and requires multiple deployments. /// The method takes /// 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 /// /// This example shows declaring two parameters to capture the custom domain and certificate name and /// passing them to the - /// method via the + /// method via the /// extension method. /// /// var builder = DistributedApplication.CreateBuilder(); @@ -56,7 +57,7 @@ public static class ContainerAppExtensions [Experimental("ASPIREACADOMAINS001", UrlFormat = "https://aka.ms/dotnet/aspire/diagnostics#{0}")] public static void ConfigureCustomDomain(this ContainerApp app, IResourceBuilder customDomain, IResourceBuilder certificateName) { - if (app.ParentInfrastructure is not ResourceModuleConstruct module) + if (app.ParentInfrastructure is not AzureResourceInfrastructure module) { throw new ArgumentException("Cannot configure custom domain when resource is not parented by ResourceModuleConstruct.", nameof(app)); } diff --git a/src/Aspire.Hosting.Azure.AppContainers/PublicAPI.Unshipped.txt b/src/Aspire.Hosting.Azure.AppContainers/PublicAPI.Unshipped.txt index 3f3092f5382..4ae8b8a5e53 100644 --- a/src/Aspire.Hosting.Azure.AppContainers/PublicAPI.Unshipped.txt +++ b/src/Aspire.Hosting.Azure.AppContainers/PublicAPI.Unshipped.txt @@ -5,6 +5,7 @@ Aspire.Hosting.Azure.AzureContainerAppCustomizationAnnotation.Configure.get -> S Aspire.Hosting.AzureContainerAppContainerExtensions Aspire.Hosting.AzureContainerAppExtensions Aspire.Hosting.AzureContainerAppProjectExtensions +Aspire.Hosting.ContainerAppExtensions static Aspire.Hosting.AzureContainerAppContainerExtensions.PublishAsAzureContainerApp(this Aspire.Hosting.ApplicationModel.IResourceBuilder! container, System.Action! configure) -> Aspire.Hosting.ApplicationModel.IResourceBuilder! static Aspire.Hosting.AzureContainerAppExtensions.AddAzureContainerAppsInfrastructure(this Aspire.Hosting.IDistributedApplicationBuilder! builder) -> Aspire.Hosting.IDistributedApplicationBuilder! static Aspire.Hosting.AzureContainerAppProjectExtensions.PublishAsAzureContainerApp(this Aspire.Hosting.ApplicationModel.IResourceBuilder! project, System.Action! configure) -> Aspire.Hosting.ApplicationModel.IResourceBuilder! diff --git a/tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs b/tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs index 6aaf1f0ece6..a295117147e 100644 --- a/tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs +++ b/tests/Aspire.Hosting.Azure.Tests/AzureContainerAppsTests.cs @@ -746,7 +746,7 @@ public async Task ConfigureCustomDomainsMutatesIngress() var customDomain = builder.AddParameter("customDomain"); var certificateName = builder.AddParameter("certificateName"); - builder.AddContainerAppsInfrastructure(); + builder.AddAzureContainerAppsInfrastructure(); builder.AddContainer("api", "myimage") .WithHttpEndpoint(targetPort: 1111) .PublishAsAzureContainerApp((module, c) => @@ -764,7 +764,7 @@ public async Task ConfigureCustomDomainsMutatesIngress() container.TryGetLastAnnotation(out var target); - var resource = target?.DeploymentTarget as AzureConstructResource; + var resource = target?.DeploymentTarget as AzureBicepResource; Assert.NotNull(resource);