How to fix pipeline deployment. template.json Error: Task failed while parsing with following error: Unexpected end of JSON input
Our team is trying to set up a CI/CD pipeline to move data from Synapse Dev/Test environment to Synapse Production environment.
Each Synapse Workspace resides in its own Resource Group inside its own Subscription.
The Dev/Test workspace environment is fully built out with datasets, pipelines, linked services, pools, etc. We have exported the template files from the dev/test workspace and uploaded to our GitHub repository in our collaboration branch (main).
When deploying the pipeline in Azure DevOps we receive the following error. There seem to be no syntax errors or missing brackets and no changes were made to the file before uploading to GitHub.
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 : https://docs.microsoft.com/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment
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: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/azure-resource-group-deployment?view=azure-devops#troubleshooting
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
Also, we added the template files to the same repo as the artifacts and just added them to their own folder (as shown below)
Link to Tutorial: https://learn.microsoft.com/en-us/azure/synapse-analytics/cicd/continuous-integration-delivery#set-up-a-stage-task-for-azure-synapse-artifacts-deployment
I wonder, are we supposed to edit the ARM template before loading to GitHub?