简体   繁体   English

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

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

I would like to deploy simple bicep for deploying Azure Storage.我想部署简单的二头肌来部署 Azure 存储。 But I'm getting strange errors.但是我遇到了奇怪的错误。

Could it be that there is compatibility issues on Az or powershell?会不会是Az或者powershell有兼容性问题? What commands solve the issue.什么命令解决了这个问题。

New-AzResourceGroupDeployment -TemplateFile main.bicep新的 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 get-installedModule -Name Az

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

az version版本

{
  "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": {}
}

I tried also CLI on command line, but got error:我也在命令行上尝试了 CLI,但出现错误:

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

Run the commands below since it is likely that your PowerShell and Bicep are running different versions.运行以下命令,因为您的 PowerShell 和 Bicep 可能运行不同的版本。 Likely, PowerShell is older. PowerShell 可能更旧。 Update using the commands below.使用以下命令更新。

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

More information can be found on the following page: https://learn.microsoft.com/en-us/answers/questions/521002/bicep-deployment-failing-on-certain-environments-n.html更多信息可以在以下页面找到: 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.

相关问题 Bicep 部署错误:读取文件时出错。 找不到路径“/home/vsts/work/1/s/bicep/storageaccount.bicep”的一部分 - Bicep Deployment error : An error occurred reading file. Could not find a part of the path '/home/vsts/work/1/s/bicep/storageaccount.bicep' Azure sku Standard_LRS 的存储帐户 bicep 部署失败 - Azure Storage Accounts bicep deployment fails for sku Standard_LRS Big Query 作业失败并显示“遇到错误字符 (ASCII 0)”。 - Big Query job fails with "Bad character (ASCII 0) encountered." VS Code Azure 部署 Python Http 触发器 function 失败 - 未找到 GLIB_2.27 - VS Code Azure deployment of Python Http Trigger function fails - GLIB_2.27 not found 使用 Visual Studio Code 和 Docker 持续开发和部署 Django 应用程序 - Continuously develop and deploy a Django app with Visual Studio Code and Docker AWS Toolkit Visual Studio Code Mac 无法找到凭证 - AWS Toolkit Visual Studio Code Mac Unable to locate credentials Firebase function 由于神秘的语法错误而无法从 Visual Studio 部署(请参阅屏幕截图或屏幕录像) - Firebase function fails to deploy from visual studio due to mysterious syntax errors (see screenshot or screen recording) Flutterfire 配置意外字符(字符 1)错误 - Flutterfire configure Unexpected character (at character 1) error 配置阶段时遇到错误:在 python 转换、数据融合中运行自定义代码时出现“null” - Error encountered while configuring the stage: 'null' while running custom code in python transform, data fusion RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0' in python - RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0' in python
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM