Can't get Docker Container username and password from ContainersRegistry #3725
-
First off, very new to azure. We've created a container registry in its own resource group to house a couple of Docker images of a couple of simple web apps. I can't for the life of me get the creds within the bicep file. The admin user is enabled and If I put in the hard-coded username and one of the passwords, everything works fine. I've tried the following:
I'm running this in VS code in cmdline: PS> az deployment sub create -f ./main.bicep -l eastus and it throws the following error: I have the role of "owner", is there something I'm missing. There's a lot more going on with this deployment but as I said, I have to hardcode the password to get this website to work. Regards, |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
Can you confirm a few things:
...
output credentials object = acr.listCredentials() // this is a new way of calling list* functions that we just shipped |
Beta Was this translation helpful? Give feedback.
-
Ok - this has really been driving me crazy. Whenever I try and use the listCredentials() within the Website resource to my Container Registry I get Access Denied. When using
then changing it to:
Does it have anything to do with the API versions? Is there an issue trying to reference the acr in another ResourceGroup from the website? Have no idea. I gotta be doing something wrong. Here are the outputs in the portal after hardcoding the username and password: |
Beta Was this translation helpful? Give feedback.
-
Ok - so it appears the only way I could get this to work is if I created the params in my main.bicep and pass in the parameters to my deployWebsite.bicep. I know in my original question and follow up I had the wrong value for DOCKER_REGISTRY_SERVER_URL, I had it as 'acr.properties.loginServer', that needed to be 'https://${acr.properties.loginServer}' but I tried that too, and even if I only hardcoded the url, still got invalid access
|
Beta Was this translation helpful? Give feedback.
-
@naveedaziz -- any idea why the credentials for this ACR reference only works when the username and password are passed in as secure values? Seems nothing else is different between the working code sample and the others. |
Beta Was this translation helpful? Give feedback.
-
Let me know if there is anything else you would like from me. If this matters -
|
Beta Was this translation helpful? Give feedback.
-
I'm not sure this is totally what you're after, but you may find some useful pointers from @jamiemccrindle's post here: https://foldr.uk/azure-bicep-app-service-custom-container |
Beta Was this translation helpful? Give feedback.
Ok - so it appears the only way I could get this to work is if I created the params in my main.bicep and pass in the parameters to my deployWebsite.bicep. I know in my original question and follow up I had the wrong value for DOCKER_REGISTRY_SERVER_URL, I had it as 'acr.properties.loginServer', that needed to be 'https://${acr.properties.loginServer}' but I tried that too, and even if I only hardcoded the url, still got invalid access