Hello community. I have an existing Azure contain...
# python
b
Hello community. I have an existing Azure container registry which I imported and I am uising it in my pulumi code. I need to pull a docker image hosted there in order to reference it into an azure app service. Right now, I am creating the azure app service plan and the web app service. Taking as reference this docker azure app service example, they are building the image there I am just wondering whether is possible to pull an existing image as long I got the existing container registry instance. Is that possible? In this case, the
docker.Image
resource they use is not useful since
build
parameter is required. I am seeing this
docker.RemoteImage
resource from docker pulumi api, but not sure how to indicate it that the image should be pulled from my container registry I got previously. The code for getting my container registry is:
Copy code
container_image = "wmlab"

# GETTING MY CONTAINER REGISTRY
rhdhv_container_registry = azure_native.containerregistry.Registry(
    "rhdhvContainerRegistry",
    admin_user_enabled=True,
    location="westeurope",
    network_rule_set=azure_native.containerregistry.NetworkRuleSetArgs(
        default_action="Allow",
    ),
    registry_name="rhdhvContainerRegistry",
    resource_group_name="genericRG1",
    sku=azure_native.containerregistry.SkuArgs(
        name="Premium",
    ),
    opts=pulumi.ResourceOptions(protect=True))

# OUTPUT THE CREDENTIALS TO GET THEM
acr_credentials = pulumi.Output.all("genericRG1", rhdhv_container_registry.name).apply(
    lambda args: azure_native.containerregistry.list_registry_credentials(
        resource_group_name=args[0],
        registry_name=args[1]
    )
)
admin_username = acr_credentials.username
admin_password = acr_credentials.passwords[0]["value"]
Not sure if perhaps I have to use
azure_native.containerregistry.Registry
(here it is) since it has a
get
method when an instance of a container registry is gotten, such as is shown at the attached picture. The point is I don’t know how to use that get method I am a bit confused about how to pull an image from the existing container registry I got. Or perhaps does it need to be build and pushed from the same project? I would say should be possible to get an existing one. I need this because the build process is taking place in another repository project