繁体   English   中英

在 Visual Studio Code 上部署 Bicep 失败 - 解析值时遇到意外字符:r。路径“”

[英]Deployment of Bicep fails on Visual Studio Code - Unexpected character encountered while parsing value: r. Path ''

我想部署简单的二头肌来部署 Azure 存储。 但是我遇到了奇怪的错误。

会不会是Az或者powershell有兼容性问题? 什么命令解决了这个问题。

新的 AzResourceGroupDeployment-TemplateFile main.bicep

New-AzResourceGroupDeployment -TemplateFile main.bicep
New-AzResourceGroupDeployment : Unexpected character encountered while parsing value: r. Path '', line 0, position 0.
+ New-AzResourceGroupDeployment -TemplateFile main.bicep

get-installedModule -Name Az

Version    Name                                Repository           Description
-------    ----                                ----------           -----------
3.7.0      Az                                  PSGallery            Microsoft Azure PowerShell - Cmdlets to manage resources in Azu... 

版本

{
  "azure-cli": "2.4.0",
  "azure-cli-command-modules-nspkg": "2.0.3",
  "azure-cli-core": "2.4.0",
  "azure-cli-nspkg": "3.0.4",
  "azure-cli-telemetry": "1.0.4",
  "extensions": {}
}

我也在命令行上尝试了 CLI,但出现错误:

az deployment group create --resource-group kensbicep-rg --template-file main.bicep
Expecting value: line 1 column 1 (char 0)

运行以下命令,因为您的 PowerShell 和 Bicep 可能运行不同的版本。 PowerShell 可能更旧。 使用以下命令更新。

Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force -AllowClobber
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

更多信息可以在以下页面找到: https://learn.microsoft.com/en-us/answers/questions/521002/bicep-deployment-failing-on-certain-environments-n.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM