title: How to deploy to azure web app containers using a docker hub registry
body: <p>As part of my azure pipelibe I build a docker image and push it to my docker hub registry. Then I would need to deploy it to an Azure Web App for Containers and for that I have been trying to add the code below:</p>
  <pre><code>- stage: Deploy
  displayName: Deploy to App Service
  jobs:
    - job: Deploy
      displayName: Deploy
      pool:
        vmImage: 'ubuntu-latest'
      steps:
        - task: AzureRmWebAppDeployment@4
          inputs:
            ConnectionType: 'AzureRM'
            azureSubscription: $(azureSubscription)
            appType: 'webAppContainer'
            WebAppName: $(webappName)
            DockerNamespace: 'https://index.docker.io/v1'
            DockerRepository: 'my_id/name_of_my_image'
            DockerImageTag: $(tag)
  </code></pre>
  <p>But I keep receiving the below error on the portal logs in the container settings</p>
  <blockquote>
  <p>ERROR - DockerApiException: Docker API responded with status code=BadRequest, response={&quot;message&quot;:&quot;invalid reference format&quot;}</p>
  </blockquote>
  <p>The repo is private but I have tried to change it to public and that didn't work either, and I have a connection service to docker hub and the app settings, not sure if were needed, have the correct values</p>
  <p><a href="https://i.stack.imgur.com/UqmHp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UqmHp.png" alt="app settings" /></a></p>
  <p>I have found much more documentation when using azure registry but the few I found for docker hub hasn't helped me so would appreciate it if someone knows what to do here</p>
  <p>Thanks</p>