Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Any bicep file for ARM Template deployment gives the error: "Task failed while parsing with following error: Unexpected token p in JSON at position 0." #20795

Open
1 of 4 tasks
bobbintb opened this issue Jan 21, 2025 · 1 comment

Comments

@bobbintb
Copy link

Task name

ARM Template deployment

Task version

3.x.x

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

Version Azure DevOps Server 2020 Update 1.2

Operation system

Windows Server 2016 Datacenter

Question

I get the same error with any bicep file I try:

2025-01-21T16:23:45.0332306Z ##[error]Error: Ensure the Template file ( 'F:\DEVPipeline\agent\_work\r6\a\_dev\drop\dev-kv\template.bicep' ) is valid. Task failed while parsing with following error: Unexpected token p in JSON at position 0

The agent has Bicep CLI version 0.32.4 and Azure-CLI 2.67.0. The bicep file starts with `param` so it seems like it errors at the very beginning and since it mentions JSON, it seems to be expecting ARM instead of bicep. I don't know how to determine the specific task version. I have it set to use 3 so it should use the latest. The Bicep and Azure CLI versions are the latest at this time and meet the minimum for bicep support for the task. The bicep file is valid, exported from a working environment and decompiled. I've tried other bicep files as well and I get the same issue with all of them.
@bobbintb
Copy link
Author

bobbintb commented Feb 3, 2025

I think I found part of the issue. I installed bicep under my user and it didn't install it system-wide. The Azure Pipeline Agent also runs under the NT AUTHORITY\NETWORK SERVICE user. I checked and the profile for that user does have bicep installed it seems and I modified the AZURE_CONFIG_DIR variable to point to it but it still seems to have an issue. I think I'm on the right track but still not quite there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant