<p>Below is my yaml file to create a container group with two containers names as fluentd and mapp.
But for the mapp container I want to get the image from a private repository. I am not using Azure Container Registry, I do not have an experience with it either.
I want to push the logs to Loganalytics.</p>
<pre><code>apiVersion: 2019-12-01
location: eastus2
name: mycontainergroup003
properties:
  containers:
  - name: mycontainer003
    properties:
      environmentVariables: []
      image: fluent/fluentd
      ports: []
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 1.5 
  - name: mapp-log 
    properties: 
    image: reg-dev.rx.com/gl/xg/iss/mapp/com.corp.mapp:1.0.0-SNAPSHOT_latest
    resources:
      requests: 
        cpu: 1 
        memoryInGb: 1.5 
    ports:  
    - port: 80  
    - port: 8080 
    command:  - /bin/sh - -c  - &gt;  i=0;  while true;  do  echo &quot;$i: $(date)&quot; &gt;&gt; /var/log/1.log;  echo &quot;$(date) INFO $i&quot; &gt;&gt; /var/log/2.log;  i=$((i+1));  sleep 1;  done 
  imageRegistryCredentials: 
  - server: reg-dev.rx.com 
    username: &lt;username&gt; 
    password: &lt;password&gt; 
  osType: Linux 
  restartPolicy: Always 
  diagnostics: 
    logAnalytics: 
      workspaceId: &lt;id&gt; 
      workspaceKey: &lt;key&gt; 
tags: null 
type: Microsoft.ContainerInstance/containerGroups
</code></pre>
<p>I am executing below command to run the yaml:</p>
<pre><code>&gt;az container create -g rg-np-tp-ip01-deployt-docker-test --name mycontainergroup003  --file .\azure-deploy-aci-2.yaml
(InaccessibleImage) The image 'reg-dev.rx.com/gl/xg/iss/mapp/com.corp.mapp:1.0.0-SNAPSHOT_latest' in container group 'mycontainergroup003' is not accessible. Please check the image and registry credential.
Code: InaccessibleImage
Message: The image 'reg-dev.rx.com/gl/xg/iss/mapp/com.corp.mapp:1.0.0-SNAPSHOT_latest' in container 
group 'mycontainergroup003' is not accessible. Please check the image and registry credential.
</code></pre>
<p>How can I make the imageregistry reg-dev.rx.com accessible from Azure. Till now, I used the same imageregistry in every yaml and ran 'kubectl apply' command. But now I am trying to run the yaml via Azure cli.
Can someone please help?</p>

UnicsSol
<p>The Error you are getting usually comes when you are giving wrong name and credentials for login server or Image that you are trying to pull.</p>
<p>I Can not tested as which private registry you are trying to use. But same thing can use achive using Azure Container registry. I tested in my environment and its working fine for me same you can apply in your environment as well.</p>
<p><strong>You can pushed your existing image into ACR using below command</strong></p>
<p>Example : you can apply like this below</p>
<p>Step 1 : <strong>login in azure</strong></p>
<pre><code> az login
</code></pre>
<p>Step 2: <strong>Created Container Registry</strong></p>
<pre><code>az acr create -g &quot;&lt;resource group&gt;&quot; -n &quot;TestMyAcr90&quot; --sku Basic --admin-enabled true
</code></pre>
<p>.</p>
<p>Step 3 :<strong>Tag docker image in the following format <code>loginserver/imagename</code></strong></p>
<p><code>docker tag 0e901e68141f testmyacr90.azurecr.io/my_nginx</code><br />
<a href="https://i.stack.imgur.com/CNuwF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CNuwF.png" alt="enter image description here" /></a></p>
<p>Step 4 : <strong>login to ACR</strong>.</p>
<p><code>docker login testmyacr90.azurecr.io</code></p>
<p>Step 5 : <strong>Push docker images into container registry</strong></p>
<pre><code>docker push testmyacr90.azurecr.io/my_nginx
</code></pre>
<p><a href="https://i.stack.imgur.com/m6fo8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/m6fo8.png" alt="enter image description here" /></a></p>
<p><strong>YAML FILE</strong></p>
<pre><code>apiVersion: 2019-12-01
location: eastus2
name: mycontainergroup003
properties:
  containers:
  - name: mycontainer003
    properties:
      environmentVariables: []
      image: fluent/fluentd
      ports: []
      resources:
        requests:
          cpu: 1.0
          memoryInGB: 1.5
  - name: mapp-log
    properties:
      image: testmyacr90.azurecr.io/my_nginx:latest
      resources:
        requests:
          cpu: 1
          memoryInGb: 1.5
      ports:
      - port: 80
      - port: 8080
      command:
        - /bin/sh
        - -c
        - &gt;
          i=0;
          while true;
          do
            echo &quot;$i: $(date)&quot; &gt;&gt; /var/log/1.log;
            echo &quot;$(date) INFO $i&quot; &gt;&gt; /var/log/2.log;
            i=$((i+1));
            sleep 1;
          done
  imageRegistryCredentials:
  - server: testmyacr90.azurecr.io
    username: TestMyAcr90
    password: SJ9I6XXXXXXXXXXXZXVSgaH
  osType: Linux
  restartPolicy: Always
  diagnostics:
    logAnalytics:
      workspaceId: dc742888-fd4d-474c-b23c-b9b69de70e02
      workspaceKey: ezG6IXXXXX_XXXXXXXVMsFOosAoR+1zrCDp9ltA==
tags: null
type: Microsoft.ContainerInstance/containerGroups
</code></pre>
<p>You can get the loginserver name , Username and password of ACR from here.</p>
<p><a href="https://i.stack.imgur.com/YGqN7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YGqN7.png" alt="enter image description here" /></a></p>
<p><strong>Succesfully run the file and able to create Container Group along with two container as declare in file.</strong></p>
<p><a href="https://i.stack.imgur.com/kAn0r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kAn0r.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/57j1A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/57j1A.png" alt="enter image description here" /></a></p>
