Skip to content

Commit 22223fe

Browse files
authored
Address feedback on Azure Container Registry (#9131)
1 parent 852af12 commit 22223fe

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,11 @@ public async Task BeforeStartAsync(DistributedApplicationModel appModel, Cancell
6262
// Capture information about the container registry used by the
6363
// container app environment in the deployment target information
6464
// associated with each compute resource that needs an image
65-
#pragma warning disable ASPIRECOMPUTE001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
6665
r.Annotations.Add(new DeploymentTargetAnnotation(containerApp)
6766
{
6867
ContainerRegistry = caes.FirstOrDefault(),
69-
ComputeEnvironment = environment as IComputeEnvironmentResource
68+
ComputeEnvironment = environment as IComputeEnvironmentResource // will be null if azd
7069
});
71-
#pragma warning restore ASPIRECOMPUTE001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
7270
}
7371

7472
static void SetKnownParameterValue(AzureBicepResource r, string key, Func<AzureBicepResource, object> factory)

src/Aspire.Hosting.Azure.ContainerRegistry/Aspire.Hosting.Azure.ContainerRegistry.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>$(DefaultTargetFramework)</TargetFramework>
55
<IsPackable>true</IsPackable>
6-
<PackageTags>aspire integration hosting azure containerregistry</PackageTags>
6+
<PackageTags>aspire integration hosting azure container registry</PackageTags>
77
<Description>Azure Container Registry resource types for .NET Aspire.</Description>
88
<EnablePackageValidation>false</EnablePackageValidation>
99
<SuppressFinalPackageVersion>true</SuppressFinalPackageVersion>

src/Aspire.Hosting.Azure.ContainerRegistry/AzureContainerRegistryResource.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ public class AzureContainerRegistryResource(string name, Action<AzureResourceInf
1818
/// <summary>
1919
/// The name of the Azure Container Registry.
2020
/// </summary>
21-
public BicepOutputReference RegistryName => new("name", this);
21+
public BicepOutputReference NameOutputReference => new("name", this);
2222

2323
/// <summary>
2424
/// The endpoint of the Azure Container Registry.
2525
/// </summary>
2626
public BicepOutputReference RegistryEndpoint => new("loginServer", this);
2727

2828
/// <inheritdoc/>
29-
ReferenceExpression IContainerRegistry.Name => ReferenceExpression.Create($"{RegistryName}");
29+
ReferenceExpression IContainerRegistry.Name => ReferenceExpression.Create($"{NameOutputReference}");
3030

3131
/// <inheritdoc/>
3232
ReferenceExpression IContainerRegistry.Endpoint => ReferenceExpression.Create($"{RegistryEndpoint}");
@@ -35,7 +35,7 @@ public class AzureContainerRegistryResource(string name, Action<AzureResourceInf
3535
public override ProvisionableResource AddAsExistingResource(AzureResourceInfrastructure infra)
3636
{
3737
var store = ContainerRegistryService.FromExisting(this.GetBicepIdentifier());
38-
store.Name = RegistryName.AsProvisioningParameter(infra);
38+
store.Name = NameOutputReference.AsProvisioningParameter(infra);
3939
infra.Add(store);
4040
return store;
4141
}

src/Aspire.Hosting.Azure.ContainerRegistry/ContainerRegistryReferenceAnnotation.cs renamed to src/Aspire.Hosting/ApplicationModel/ContainerRegistryReferenceAnnotation.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
// Licensed to the .NET Foundation under one or more agreements.
44
// The .NET Foundation licenses this file to you under the MIT license.
55

6-
using Aspire.Hosting.ApplicationModel;
7-
8-
namespace Aspire.Hosting.Azure;
6+
namespace Aspire.Hosting.ApplicationModel;
97

108
/// <summary>
119
/// Annotation that indicates a resource is using a specific container registry.

0 commit comments

Comments
 (0)