Dick ter Schiphorst
Dick ter Schiphorst

Reputation: 113

CI/CD Automated publish Azure Data Factory

I have some errors when trying to publish my changes automatically following this [Microsoft Documentation][1]. Please, need some support to fix this :)

Kind regards,

Dickkieee

ERROR === LocalFileClientService: Unable to read file: /home/vsts/work/1/s/arm-template-parameters-definition.json, error: {"stack":"Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/arm-template-parameters-definition.json'","message":"ENOENT: no such file or directory, open '/home/vsts/work/1/s/arm-template-parameters-definition.json'","errno":-2,"code":"ENOENT","syscall":"open","path":"/home/vsts/work/1/s/arm-template-parameters-definition.json"} WARNING === ArmTemplateUtils: _getUserParameterDefinitionJson - Unable to load custom param file from repo, will use default file. Error: {"stack":"Error: ENOENT: no such file or directory, open '/home/vsts/work/1/s/arm-template-parameters-definition.json'","message":"ENOENT: no such file or directory, open '/home/vsts/work/1/s/arm-template-parameters-definition.json'","errno":-2,"code":"ENOENT","syscall":"open","path":"/home/vsts/work/1/s/arm-template-parameters-definition.json"

- main 
pool:
  vmImage: 'ubuntu-latest'
steps:
- task: NodeTool@0
  inputs:
    versionSpec: '10.x'
  displayName: 'Install Node.js'
 
- task: Npm@1
  inputs:
    command: 'install'
    verbose: true
  displayName: 'Install npm package'
- task: Npm@1
  inputs:
    command: 'custom'
    customCommand: 'run build validate $(Build.Repository.LocalPath) /subscriptions/xxxxxxxxx/resourceGroups/RG-Dick-DP203/providers/Microsoft.DataFactory/factories/df-testfactory-dev-9999'

  displayName: 'Validate'
 
# Validate and then generate the ARM template into the destination folder. Same as clicking "Publish" from UX
# The ARM template generated is not published to the ‘Live’ version of the factory. Deployment should be done using a release pipeline.
- task: Npm@1
  inputs:
    command: 'custom'
    customCommand: 'run build export $(Build.Repository.LocalPath) /subscriptions/xxxxxxxxx/resourceGroups/RG-Dick-DP203/providers/Microsoft.DataFactory/factories/df-testfactory-dev-9999 "ArmTemplate"'
  displayName: 'Validate and Generate ARM template'
 
# Publish the Artifact to be used as a source for a release pipeline
- task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.Repository.LocalPath)/ArmTemplate'
    artifact: 'ArmTemplates'
    publishLocation: 'pipeline'```

[Repo][2]
[Build][3]


  [1]: https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment-improvements
  [2]: https://i.sstatic.net/Mv0mg.png
  [3]: https://i.sstatic.net/uirN1.png

Upvotes: 1

Views: 708

Answers (1)

mjharper
mjharper

Reputation: 145

I also had this error when automating ADF deployment. The file that is missing gets automatically added to your repo when you want to customize the parameters in the resource manager template as outlined here: https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#use-custom-parameters-with-the-resource-manager-template

To override the default Resource Manager parameter configuration, go to the Manage hub and select ARM template in the "Source control" section. Under ARM parameter configuration section, click Edit icon in "Edit parameter configuration" to open the Resource Manager parameter configuration code editor.

Creating a custom Resource Manager parameter configuration creates a file named arm-template-parameters-definition.json in the root folder of your git branch. You must use that exact file name.

I think it's safe to create this file and use the default values provided even if you don't need to customize the parameters. From my tests it also seems to be safe to ignore the error.

Upvotes: 1

Related Questions