-
Notifications
You must be signed in to change notification settings - Fork 775
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
New-AzResourceGroupDeployment : Unexpected character encountered while parsing value: @. Path '', line 0, position 0. At line:1 char:1 #15959
Comments
Is the Az CLI using the same version? It maintains its own copy, and you can query the verison with |
Would you be able to share a minimal template that reproduces the issue? |
The below content reproduces the issue @description('Location to deploy resources to. Eg. westus2, eastus, central us') @description('Name of the ACR managed identity') @description('Create managed identity to be used by AKS to pull images from ACR') |
The below content reproduces the issue
|
@StutiSri I just tried out the repro and the deployment succeeded for me without the error that you reported. I tried a command like this with your file:
I've also tried without The one difference I see with my repro and yours is that the template file is on OneDrive. Can you try moving the template file outside of your OneDrive folder to see if it makes a difference? Also is there anything about how you're running the command that could be considered "special" or "unusual"? |
Given the verbose logs you've shared, it seems like Azure PowerShell has assumed this is an ARM template without even attempting to read it as a Bicep file. If it had detected it as a Bicep file, I would expect to see these lines logged: The possible explanations I can think of for this are either:
|
I moved the template to the same directory and still got the same error PS C:\Users\stsrivastava> New-AzResourceGroupDeployment -ResourceGroupName ImpactRP-DEVTEST-Infra-Common -TemplateFile "test.bicep" -Debug -Verbose Confirm Confirm
DEBUG: Request [13a6ddb1-497a-4188-aaf1-45be4826cd1a] GET Confirm
DEBUG: 11:54:27 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = []. |
I have upgraded az module as well PS C:\Users\stsrivastava> Get-InstalledModule -Name Az -AllVersions Version Name Repository Description 12.1.0 Az PSGallery Microsoft Azure PowerShell - Cmdlets to manage resources in Azure. This module is compatible with PowerShell and Windows PowerShell.... |
Thankyou @anthony-c-martin, that worked like magic! |
PS C:\Users\stsrivastava> New-AzResourceGroupDeployment -ResourceGroupName ImpactRP-DEVTEST-Infra-Common -TemplateFile "C:\Users\stsrivastava\OneDrive - Microsoft\Projects\AzImpactRP\deploy\release-scripts\scripts\provisioning/templates/test.bicep" -Debug -Verbose
DEBUG: 10:35:20 AM - NewAzureResourceGroupDeploymentCmdlet begin processing with ParameterSet
'ByTemplateFileWithNoParameters'.
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
DEBUG: 10:35:30 AM - using account id '[email protected]'...
DEBUG: 10:35:30 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
Confirm
Are you sure you want to perform this action?
Performing the operation "Creating Deployment" on target "ImpactRP-DEVTEST-Infra-Common".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): A
Redacted info related to login
DEBUG: [Common.Authentication]: Received token with LoginType 'User', Tenant: '72f988bf-86f1-41af-91ab-2d7cd011db47',
UserId: '[email protected]'
DEBUG: 10:35:34 AM - [ConfigManager] Got [False] from [EnableDataCollection], Module = [], Cmdlet = [].
Confirm
Unexpected character encountered while parsing value: @. Path '', line 0, position 0.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
New-AzResourceGroupDeployment : Unexpected character encountered while parsing value: @. Path '', line 0, position 0.
At line:1 char:1
DEBUG: 10:35:42 AM - [ConfigManager] Got nothing from [DisplayBreakingChangeWarning], Module = [], Cmdlet = [].
Returning default value [True].
DEBUG: 10:35:42 AM - NewAzureResourceGroupDeploymentCmdlet end processing.
Powershell Version
PS C:\Users\stsrivastava> $PSVersionTable
Name Value
PSVersion 5.1.26100.2161
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.2161
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
bicep version
PS C:\Users\stsrivastava> bicep --version
TRACE: Bicep version: 0.32.4+b326faa456, CLI arguments: "--version"
Bicep CLI version 0.32.4 (b326faa)
PS C:\Users\stsrivastava>
Az.Resources Version
PS C:\Users\stsrivastava> Get-InstalledModule -Name Az.Resources
Version Name Repository Description
7.7.0 Az.Resources PSGallery Microsoft Azure PowerShell - Azure Resource Manager and Active Directory cmdlets in Windows PowerShell and PowerShell Core. Manages subs.
The solutions mentioned here didnt help: #3140
I am able to deploy this template successfully using Az CLI.
The text was updated successfully, but these errors were encountered: