Error on Azure IoT Edge Task in Release pipeline for docker hub image pull

Dhanavath Vishnu 366 Reputation points
2023-05-02T15:12:22.1466667+00:00

Hi Team

Hi @satishbodduakon

I am facing an issue in my standard IoT edge deployment template in the release pipeline. In the template I have declared mongo dB has one of the modules, the image URL I am using his: docker.io/library/mongo:4.4.18. While I am doing the deployment manually using the portal, it is able to successfully pull the image deploy on the virtual machine.

But while I use the same template to generate from the pipeline, during the deployment to the device using Azure IoT Edge Task, I am getting the following error.

User's image

As I am not having any docker credentials while doing from the portal, should I need to pass the docker registry details in the template file so this error will go away. As I see the image is public, without docker credentials also it should work right?

Please clarify, if any docs to refer please do let me know.

D. Vishnu

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
580 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,218 questions
{count} vote

Accepted answer
  1. LeelaRajeshSayana-MSFT 16,701 Reputation points
    2023-05-05T12:30:58.41+00:00

    @Dhanavath Vishnu We have update from our team on this issue.

    Based on the logs the team has analyzed so far, the root cause of the issue is due to the docker CLI failing to authenticate. This issue can manifest itself in either the 'push' action or the 'deploy' action of the AzureIoTEdgeV2 devops task.

    The team is still working on a permanent fix. To mitigate this in the meantime, please follow the below steps.

    For push action:

    - task: Docker@2
      displayName: push
      inputs:
        containerRegistry: <Docker-registry-service-connection-name>
        repository: '<DockerHub-repository-name>'
        command: push
        tags: '<module-version>-<module-arch>' #ex: 0.0.1-amd64
    
    

    For deploy action:

    - task: AzureCLI@2
      displayName: 'Azure CLI '
      inputs:
        azureSubscription: '<Azure-Resource-Manager-service-connection-name>'
        scriptType: bash
        scriptLocation: inlineScript
        inlineScript: |
         az extension add --name azure-iot
    
    

    Please make sure to delete any previous deployments if they exist and create a new deployment using the following steps.

    Update to address docker login error

    Replace Azure IoT Edge - Deploy to IoT Edge devices job with this Azure CLI job. Both are equivalent and can be used interchangeably.

    - task: AzureCLI@2
      displayName: 'Azure CLI '
      inputs:
        azureSubscription: '<Azure-Resource-Manager-service-connection-name>'
        scriptType: bash
        scriptLocation: inlineScript
        inlineScript: |
         az extension add --name azure-iot
    
    

    Please ensure to delete any existing deployments and create new one using the steps below:

    # Delete previous deployment, if one exists      
    project=$(echo $(System.TeamProject) | tr [:upper:] [:lower:])      
    az iot edge deployment delete --deployment-id $project-devops-deployment --hub-name <IoTHub-name> || true       
    # Create a new deployment      
    az iot edge deployment create --deployment-id $(System.TeamProject)-devops-deployment --hub-name <IoTHub-name> --content $(System.DefaultWorkingDirectory)/config/deployment.json --target-condition "deviceId='<device-name>'" --priority 10 --output none
    
    
    

    Please let us know if you encounter any issues or need further clarifications on the above.


    If the response helped, please do click Accept Answer and Yes. Doing so would help other community members with similar issue identify the solution. I highly appreciate your contribution to the community.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.