I'm trying to integrate Azure.ResourceManager.AppContainers with Azure.ResourceManager.ContainerRegistry but I'm unclear on how to use them together. I'm attempting to set up a container app configuration and have provided a prototype of my code below:
// Load the container registry
var registries = await arm.GetContainerRegistriesAsync();
// Select the first registry
var registry = registries.First();
// Create a new container app configuration
var appConfig = new ContainerAppConfiguration()
{
Ingress =
{
AllowInsecure = false,
TargetPort = service.dockerProfile.InternalPort,
ExposedPort = service.dockerProfile.ExternalPort,
Transport = Azure.ResourceManager.AppContainers.Models.ContainerAppIngressTransportMethod.Http,
External = service.dockerProfile.ExternalPort is not null
},
Registries =
{
// How should I integrate the registry here?
}
};
var container = await arm.CreateContainerApp(service.containerAppName, new(Azure.Core.AzureLocation.SouthCentralUS)
{
EnvironmentId = environment.Id,
Configuration = appConfig
});
Has anyone encountered a similar situation or knows how to correctly set up the registries section? I've been unable to find documentation addressing this specific use case. If I get clarity, I'll be happy to contribute to the documentation to assist others in the future.