Container Apps with Azure Container Registry
New quickstart to demonstrate how to use a ACR from Container Apps, leveraging a User Assigned Managed Identity.
PR Checklist
Check these items before submitting a PR...
- [x] - Please check this box once you've submitted the PR if you've read through the Contribution Guide and best practices checklist.
@Gordonby , i am trying to do something very similar over in this PR. https://github.com/Azure/azure-quickstart-templates/pull/12699 Except, instead of the images being truely public, I am trying to ingest images from the Azure Marketplace.
I am still debugging some issues with my custom script action, but do you think it would make sense to include this directly in your bicep module you are using instead?
@Gordonby , i am trying to do something very similar over in this PR. #12699 Except, instead of the images being truely public, I am trying to ingest images from the Azure Marketplace.
I am still debugging some issues with my custom script action, but do you think it would make sense to include this directly in your bicep module you are using instead?
@dciborow You're meaning your container_deploy.sh ?
This PR is relating primarily to Container Apps, the importing of images is just leveraging an existing module in the bicep registry. It's not really a focus of the quickstart template.
If you're wondering if I think the script is a good addition to the existing import module in the public bicep registry, I think submitting it as a new module proposal would be the better option.
@bmoore-msft - I think the best practice checking in the CICD is being confused because either
- there's a parameter called images and also an output by the same name.
- the array output only contains one item, and powershell (or something else) is simplifying it to a string
This template deploys great locally, but the best-practice warning fails in the CICD.
Type Mismatch: Parameter 'images' in nested template 'importContainerImage' is defined as array, but the parent template defines it as string). Line: 352, Column: 14
@bmoore-msft - thoughts on my last comment?
the best practice test won't fail the pipeline (just a warning) but the build has been deleted so can't see the error... I'll start another build.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
@Gordonby - can you check the deployment failure?
@Gordonby - can you check the deployment failure?
@bmoore-msft
1
Microsoft.Authorization/roleAssignments uses a preview version ( 2020-10-01-preview ) and there are more recent versions available. Line: 114, Column: 8
Ok, new error - easy to fix....
2
[error] Type Mismatch: Parameter 'images' in nested template 'importContainerImage' is defined as array, but the parent template defines it as string). Line: 352, Column: 14
This was the error message that was confusing me before. Images is a parameter in the bicep registry module. It's defined as array.
3
Function 'format' found within 'acrHostedImageUri'
Another new error...
Not sure why using format is a bad thing...? I'm using it to manipulate the image string from the public registry to the private one that its now in.

output images array = [for image in images: {
originalImageUri: image
acrHostedImageUri : '${acr.properties.loginServer}${skip(image, indexOf(image,'/'))}'
}]
2 - looks to be a limitation in the TTK 3 - use the uri() function to create uris
@bmoore-msft
2 - ok 3 - URI sounds great, but i'm not sure if it's entirely geared towards a container registry
The template language function 'uri' expects its first argument to be a uri string. The provided value is 'crijuu6sairdtri.azurecr.io'
Try:
acrHostedImageUri : uri('https://${acr.properties.loginServer}', string(skip(image, indexOf(image, '/'))))
The last string() requirement seems like a bicep bug - but should work in any case...
@bmoore-msft i think this is about ready now