运行 azure cli 中多行语句

Run statement with multiple lines in azure cli

我是 ARM 模板和 Azure CLI 的新手

这似乎是一个非常愚蠢的问题,但我正在使用教程 here

它包含以下命令

templateFile="my template file"
az deployment group create \
  --name blanktemplate \
  --resource-group myResourceGroup \
  --template-file $templateFile

我运行正在通过命令提示符使用 Azure Cli

我怎么能运行这个?由于有多行

保罗

将每行末尾的反斜杠 (\) 替换为反引号 (`),您应该可以 运行 了。您的带有反引号的示例代码:

templateFile="my template file" `
az deployment group create `
  --name blanktemplate `
  --resource-group myResourceGroup `
  --template-file $templateFile 

例如下面的代码如果直接复制粘贴shell就会在云端执行

 Write-Host `
 Hello, `
 World!

还有一个办法。您可以在云端创建一个临时的 PowerShell 脚本文件 shell。根据需要粘贴所有命令,然后 运行 来自云的脚本文件 shell。