如何修复Synapse CI/CD部署中template.json的JSON输入意外结束错误
Synapse CI/CD部署ARM模板报错问题
我们团队正在搭建CI/CD流水线,将Synapse开发/测试环境的资源迁移至生产环境。每个Synapse工作区位于独立订阅下的专属资源组中,测试环境已配置好数据集、管道、链接服务、池等资源。已从Azure门户导出测试环境的ARM模板及参数文件,上传至GitHub的main协作分支。
Azure DevOps流水线报错日志
2023-03-13T22:04:51.8230701Z ##[section]Starting: ARM Template deployment: Subscription scope 2023-03-13T22:04:51.8768523Z ============================================================================== 2023-03-13T22:04:51.8769295Z Task : ARM template deployment 2023-03-13T22:04:51.8769738Z Description : Deploy an Azure Resource Manager (ARM) template to all the deployment scopes 2023-03-13T22:04:51.8770069Z Version : 3.217.1 2023-03-13T22:04:51.8770568Z Author : Microsoft Corporation 2023-03-13T22:04:51.8770987Z Help : Azure DevOps ARM部署任务文档 2023-03-13T22:04:51.8771331Z ============================================================================== 2023-03-13T22:04:53.2342898Z ARM Service Connection deployment scope - Subscription 2023-03-13T22:04:53.2526889Z Creating deployment parameters. 2023-03-13T22:04:53.2564436Z The detected encoding for file 'D:\a\r1\a\PMI-BI-Synapse-Artifacts-Source\templates\template.json' is 'utf-8' 2023-03-13T22:04:53.2601923Z ##[error]Check out the troubleshooting guide to see if your issue is addressed: ARM部署任务故障排查文档 2023-03-13T22:04:53.2623026Z ##[error]Error: Ensure the Template file ( 'D:\a\r1\a\PMI-BI-Synapse-Artifacts-Source\templates\template.json' ) is valid. Task failed while parsing with following error: Unexpected end of JSON input 2023-03-13T22:04:53.2633869Z (node:964) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 2023-03-13T22:04:53.2799021Z ##[section]Finishing: ARM Template deployment: Subscription scope
已完成的排查动作
- 上传至GitHub前未修改模板及参数文件,无语法或括号缺失问题
- 使用JSON验证器确认template.json本身格式有效
- VSCode中搭配parameters.json检查时,曾触发错误:
Template validation failed: The value of deployment parameter 'vulnerabilityAssessments_Default_storageContainerPath' is null. Please specify the value or use the parameter reference. See ARM部署参数文件说明文档 for details. - 因未启用VulnerabilityAssessments功能,已从template.json和parameters.json中移除相关配置项,但仍出现相同的JSON解析错误
内容的提问来源于stack exchange,提问作者Bill LaLonde
相关产品推荐
相关产品推荐

