根据[Microsoft Documentation][1]自动发布更改时,我遇到了一些错误。请,需要一些支持来解决这个问题:(
问候,
Dickkieee
错误===LocalFileClientService:无法读取文件:/home/vts/work/1/s/arm-template-parameters-definition.json,错误:{"堆栈":"错误:ENOENT:没有这样的文件或目录,打开'/home/vts/work/1/s/arm模板参数定义.json'","消息":"ENOENT:no such file or directory,打开'/home/vts/wwork/1/s/aarm模板参数定义json'","errno":-2,"code":"ENOENT&","syscall":"打开","路径":"/home/vsts/work/1/s/arm模板参数定义.json"}警告===ArmTemplateUtils:_getUserParameterDefinitionJson-无法从repo加载自定义参数文件,将使用默认文件。错误:{"堆栈":"错误:ENOENT:没有这样的文件或目录,打开'/home/vts/work/1/s/arm模板参数定义.json'","消息":"ENOENT:no such file or directory,打开'/home/vts/wwork/1/s/aarm模板参数定义json'","errno":-2,"code":"ENOENT&","syscall":"打开","路径":"/home/vsts/work/1/s/arm模板参数定义.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.stack.imgur.com/Mv0mg.png
[3]: https://i.stack.imgur.com/uirN1.png
我在自动化ADF部署时也遇到了这个错误。当您想要自定义资源管理器模板中的参数时,丢失的文件会自动添加到您的repo中,如下所示:https://learn.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#use-使用资源管理器模板自定义参数
要覆盖默认的资源管理器参数配置,请转到到Manage hub并在";源控制";部分在ARM参数配置部分下,单击中的编辑图标"编辑参数配置";打开"资源管理器"参数配置代码编辑器。
创建自定义资源管理器参数配置将创建根文件夹中名为arm-template-parameters-definition.json的文件你的git分支。您必须使用确切的文件名。
我认为创建此文件并使用提供的默认值是安全的,即使您不需要自定义参数。从我的测试来看,忽略错误似乎也是安全的。