question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't supply container registry credentials to Container App.

See original GitHub issue

Something is up with the Container App / Container Registry integration. I could swear that this worked a month or so ago, but I tried creating a new container app service today. This is the offending line:

containerApp {
    reference_registry_credentials [ Arm.ContainerRegistry.registries.resourceId mySuperRegistry.Name ]
}

where mySuperRegistry is an Azure container registry that already exists.

When I try an deploy the container app, I get the following validation error:

{'code': 'ContainerAppInvalidPropertyValue', 'message': "Property 'secrets.name' has an invalid value '[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').username]'. A value must consist of lower case alphanumeric characters, '-'
 or '.', and must start and end with an alphanumeric character."}
)

Here’s an extract of the raw ARM template:

          "registries": [
            {
              "passwordSecretRef": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').username]",
              "server": "[reference(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').loginServer]",
              "username": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').username]"
            }
          ],
          "secrets": [
            {
              "name": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').username]",
              "value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries', 'mySuperRegistry'), '2019-05-01').passwords[0].value]"
            }
          ]

It’s almost as though ARM hasn’t seen that secrets.name is an expression, and has instead tried to parse the expression as a raw string.

@ninjarobot Have you any idea about this - or if this ever used to work? @anthonychu has anything changed in the way that secret names are handled in terms of ARM template support - maybe something has changed since the namespace move?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
anthonychucommented, Apr 30, 2022
0reactions
isaacabrahamcommented, May 5, 2022

I see! I think it’s the same underlying issue - ARM isn’t evaluating expressions in the template in certain fields.

The fix you’ve put in is of course a really nice workaround, by not using an ARM expression at all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot login to registry - Azure Container Registry
Check Docker configuration · Specify correct registry name · Confirm credentials to access registry · Confirm credentials are authorized to access ...
Read more >
Authenticate with an Azure container registry
Each container registry includes an admin user account, which is disabled by default. You can enable the admin user and manage its credentials...
Read more >
Container App Update Fails from null secrets · Issue #259
Create a Container App and specify registry credentials. Create another container app and don't specify registry credentials. Try to update the ...
Read more >
Unable to push to Azure Container Registry : r/azuredevops
Just yesterday, all of a sudden, I have been unable to push images to the Azure Container Registry. Using YAML Pipeline Docker@2 task:...
Read more >
Troubleshooting the GitLab Container Registry
Troubleshooting the GitLab Container Registry · Migrating OCI container images to GitLab Container Registry · Docker connection error · Blob unknown to registry ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found