Issues creating AMR template: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

SilvaPaulaD 56 Reputation points
2022-09-28T12:46:15.7+00:00

Good morning, I am trying to follow tutorial https://learn.microsoft.com/en-us/training/modules/create-azure-resource-manager-template-vs-code/3-exercise-create-and-deploy-template?pivots=powershell&source=learn to create an AMR template. I followed the steps and when I try to deploy I get the following error:

New-AzResourceGroupDeployment : Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
At line:4 char:1

  • New-AzResourceGroupDeployment `
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : CloseError: (:) [New-AzResourceGroupDeployment], JsonReaderException
  • FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

When I run:

$templateFile="azuredeploy.json"
$today=Get-Date -Format "MM-dd-yyyy"
$deploymentName="blanktemplate-"+"$today"
New-AzResourceGroupDeployment -Name $deploymentName
-TemplateFile $templateFile

the azuredeploy.json file is located in my C drive.

My powershell AZ version

Get-InstalledModule -Name Az

Version Name Repository Description


8.1.0 Az PSGallery Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module is compatible with Powe...

Azure DevTest Labs
Azure DevTest Labs
An Azure service that is used for provisioning development and test environments.
255 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,546 Reputation points Microsoft Employee
    2022-09-29T04:59:03.86+00:00

    Hello @SilvaPaulaD ,
    Welcome to Microsoft QnA.
    I think you have missed the " ** " character in the first line. New-AzResourceGroupDeployment **
    -Name $deploymentName `
    -TemplateFile $templateFile

    Could you please recheck and respond? Thanks :)

    0 comments No comments