title: how to use Azure node sdk to create a container with azure private ACR image
body: <p>I have following piece of code trying to create a Azure container instance with private ACR image using Azure node sdk. </p>
  
  <pre><code>            let container = new client.models.Container();
              let acrcredentials = new client.models.ImageRegistryCredential();
              acrcredentials.server = '&lt;acrreponame&gt;.azurecr.io';
              acrcredentials.username = 'username';
              acrcredentials.password = 'password';
              acrcredentials.password = 'password';
              console.log('Launching a container for client', client);
  
              container.name = 'testcontainer';
              container.environmentVariables = [
                  {
                      name: 'SOME_ENV_VAR',
                      value: 'test'
                  }
              ];
              container.image = '&lt;acrreponame&gt;.azurecr.io/&lt;image&gt;:&lt;tag&gt;';
              container.ports = [{port: 80}];
              container.resources = {
                  requests: {
                      cpu: 1,
                      memoryInGB: 1
                  }
              };
              container.imageRegistryCredentials = acrcredentials;
              console.log('Provisioning a container', container);
  
              client.containerGroups.createOrUpdate(group, containerGroup,
                  {
                      containers: [container],
                      osType: 'linux',
                      location: 'eastus',
                      restartPolicy: 'never'
                  }
              ).then((r) =&gt; {
                  console.log('Launched:', r);
              }).catch((r) =&gt; {
                  console.log('Finished up with error', r);
              });
  </code></pre>
  
  <p>It gives me below error:</p>
  
  <pre><code>  code: 'InaccessibleImage',
    body: 
     { code: 'InaccessibleImage',
       message: 'The image \'&lt;acrreponame&gt;.azurecr.io/&lt;image&gt;:&lt;tag&gt;\' in container group \'testgroup\' is not accessible. Please check the image and registry credential.' } 
     }
  </code></pre>