azure-devopsazure-pipelinesazure-pipelines-yamlazure-artifacts

Azure DevOps build Artifact Error because of Failed to fetch ARM parameters: Error: Input required: AzureResourceManagerConnection


I want to build an Artifact via pipelines in Azure DevOps, but I have one warning and one error below.

warning:

WARNING === LocalFileClientService: Unable to read file: /home/vsts/work/1/s/template-parameters-definition.json, error: {"stack":"Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/template-parameters-definition.json'","message":"ENOENT: no such file or directory, open '/home/vsts/work/1/s/template-parameters-definition.json'","errno":-2,"code":"ENOENT","syscall":"open","path":"/home/vsts/work/1/s/template-parameters-definition.json"}

Error:

Failed to fetch ARM parameters: Error: Input required: AzureResourceManagerConnection

In my case, I only have one resource group, under the same repo, I have feature branch, develop branch and production branch. The template-parameters-definition.json file is in the workspace_publish. (I don't know why it cannot find it).

I want to build an Artifact when I trigger the pull request from develop branch to production branch.

For the AzureResourceManagerConnection, I have check it under the Service connections, we have set it up and name it:

here is the code for the yaml file:

trigger:
- production

pool:
  vmImage: ubuntu-latest

resources:
  repositories:
  - repository: repo-001
    type: git
    name: repo-001
    ref: refs/heads/production


steps:
  - checkout: repo-001
  - task: Synapse workspace deployment@2
    displayName: Validate Synapse workspace Artifacts
    inputs:
      operation: 'validateDeploy'
      ArtifactsFolder: '$(System.DefaultWorkingDirectory)'
      azureSubscription: 'devops-datalake-Development'
      ResourceGroupName: 'rg-dev-001'
      TargetWorkspaceName: 'workspace-dev-001'
      DeleteArtifactsNotInTemplate: true

  - publish: $(System.DefaultWorkingDirectory)/ExportedArtifacts
    artifact: SynapseArtifact

How could I debug it?

update: service connection 1 service connection 2


Solution

  • The warning

    WARNING === LocalFileClientService: Unable to read file: /home/vsts/work/1/s/template-parameters-definition.json, error: {"stack":"Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/template-parameters-definition.json'","message":"ENOENT: no such file or directory, open '/home/vsts/work/1/s/template-parameters-definition.json'","errno":-2,"code":"ENOENT","syscall":"open","path":"/home/vsts/work/1/s/template-parameters-definition.json"}

    is just a warning instead of an error. template-parameters-definition.json is used to override the default parameter template and different from the TemplateParametersForWorkspace.json in the workspace_publish branch. This custom parameter template must be named exactly template-parameters-definition.json and placed in the root folder of your Git collaboration branch. It is not required. See the details from Azure Synapse Analytics CI/CD with Custom Parameters.

    According to error "Failed to fetch ARM parameters: Error: Input required:AzureResourceManagerConnection", the issue seems to be related to the service connection. To verify this, you can click the Settings of task Synapse workspace deployment@2 -> select your subscription from drop down list "Synapse workspace connection type" -> click Authorize to create a new ARM service connection. Assign the service principle of the new ARM SC as workspace admin for your target workspace. Then run the pipeline again and check if it has the same error.

    enter image description here