-
Notifications
You must be signed in to change notification settings - Fork 769
Description
There are scenarios where consumers need to get access to the Azure Container Registry that an ACA or App Service Environment is going to use. For example, to set up additional roles / permissions to the ACR.
We should add a new interface that both ACA Environment Resource and App Service Environment Resource implement that exposes a method or property to retrieve the AzureContainerRegistryResource used by the compute environment. Its implementation should be the same as this method:
aspire/src/Aspire.Hosting.Azure.AppContainers/AzureContainerAppEnvironmentResource.cs
Lines 182 to 192 in f118883
| private IContainerRegistry? GetContainerRegistry() | |
| { | |
| // Check for explicit container registry reference annotation | |
| if (this.TryGetLastAnnotation<ContainerRegistryReferenceAnnotation>(out var annotation)) | |
| { | |
| return annotation.Registry; | |
| } | |
| // Fall back to default container registry | |
| return DefaultContainerRegistry; | |
| } |
But it shouldn't be nullable. It has to return a non-null instance. If there is no annotation, and the DefaultContainerRegistry is null, an exception should be thrown.