In your yaml file, you need to add the imageRegistryCredentials in the correct place under properties.
For reference take the below example. Here I have shown the location where imageRegistryCredentials has to be placed.
Hope this solves your problem.
apiVersion: 2019-12-01
location: eastus
name: securetest
properties:
imageRegistryCredentials:
- server: imageRegistryLoginServer
username: imageRegistryUsername
password: imageRegistryPassword
containers: - name: mycontainer
properties:
environmentVariables: - name: 'NOTSECRET'
value: 'my-exposed-value' - name: 'SECRET'
secureValue: 'my-secret-value'
image: <container-registry-image>
ports: []
resources:
requests:
cpu: 1.0
memoryInGB: 1.5
osType: Linux
restartPolicy: Always
tags: null
type: Microsoft.ContainerInstance/containerGroups