azure-pipelines-tasks: Azure IoT Edge: Failed to fetch container registry authentication token

Required Information

I’m trying to deploy an Azure IoT Edge module through Azure Pipelines. I’ve set up my build steps as below but it’s returning an error message on the Push module images step

Question, Bug, or Feature?
Type: Bug

Enter Task Name: AzureIoTEdge

Environment

  • Server - Azure Pipelines

  • Agent - Hosted

Issue Description

Below is a copy of my pipeline. I have a service connection set up under the name containerregistry

image

trigger:
- master

pool:
  vmImage: 'Ubuntu-16.04'

variables:
  solution: '**/*.sln'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: AzureIoTEdge@2
  inputs:
    action: 'Build module images'
    templateFilePath: 'deployment.template.json'
    defaultPlatform: 'arm32v7'
- task: AzureIoTEdge@2
  inputs:
    action: 'Push module images'
    containerregistrytype: 'Generic Container Registry'
    dockerRegistryConnection: 'containerregistry'
    templateFilePath: 'deployment.template.json'
    defaultPlatform: 'arm32v7'
    fillRegistryCredential: 'true'

Task logs

##[section]Starting: AzureIoTEdge
==============================================================================
Task         : Azure IoT Edge
Description  : Build and deploy an Azure IoT Edge image
Version      : 2.3.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/azure-iot-edge
==============================================================================
Pushing module images...
29177abd-9970-4ff3-a171-cf8cb6824915 exists true
##[error]Error: Failed to fetch container registry authentication token, please check you container registry setting in build task. The username for container registry is 
##[section]Finishing: AzureIoTEdge

Error logs

[error]Error: Failed to fetch container registry authentication token, please check you container registry setting in build task. The username for container registry is 

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@charlie-haley Can you share a sample of deployment.template.json and folder structure for your project? Something in your deployment.template.json should be inconsistent with your folder structure, so the task failed to figure out images need to be pushed (just imagine there’s a dummy module in your project, which won’t be built in your pipeline). I can share how to adjust the deployment.template.json or your folder structure.

I got the same problem. @prativen @blackchoey any progress on this issue so far?

This is also the response I get when I choose the Azure Container Registry option. (which I am using) it falsely indicates a success even though nothing has been pushed to the registry.

##[section]Starting: AzureIoTEdge
==============================================================================
Task         : Azure IoT Edge
Description  : Build and deploy an Azure IoT Edge image
Version      : 2.3.0
Author       : Microsoft Corporation
Help         : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/azure-iot-edge
==============================================================================
Pushing module images...
/home/vsts/work/1/s /home/vsts/work/1/s
iotedgedev already installed with version: version 2.1.0

[command]/usr/local/bin/iotedgedev push --no-build --file /home/vsts/work/1/s/deployment.template.json --platform arm32v7

=======================================
======== ENVIRONMENT VARIABLES ========
=======================================

.env file not found on disk. Without a file on disk, you must specify all Environment Variables at the system level. (/home/vsts/work/1/s/.env)
Validating deployment template /home/vsts/work/1/s/deployment.template.json
Validating schema of deployment template.
Deployment template schema validation passed.
Expanding image placeholders
Converting createOptions
Deleting template schema version
Expanding 'deployment.template.json' to 'config/deployment.arm32v7.json'
Validating generated deployment manifest config/deployment.arm32v7.json
Validating schema of deployment manifest.
Deployment manifest schema validation passed.
Start validating createOptions for all modules.
Validating createOptions for module edgeAgent
No settings or createOptions property found in module edgeAgent. Skip createOptions validation.
Validating createOptions for module edgeHub
No settings or createOptions property found in module edgeHub. Skip createOptions validation.
Validating createOptions for module webapp
No settings or createOptions property found in module webapp. Skip createOptions validation.
Validation for all createOptions passed.
The generated deployment file located in the path: /home/vsts/work/1/a/deployment.arm32v7.json
Expanding registry credentials in deployment file...
Finished pushing module images
##[section]Finishing: AzureIoTEdge