尝试在 Azure 上部署资源,为此我们使用 Microsoft 的 bicep。
为了执行代码,我使用 Visual Studio Code Insider。
注意这是我在此处发布的示例。
代码如下
resource stg 'Microsoft.Storage/storageAccounts@2019-06-01' = {
name: 'uniquestorage001' // must be globally unique
location: 'eastus'
kind: 'Storage'
sku: {
name: 'Standard_LRS'
}
}
在终端我们使用以下命令来构建它
二头肌构建main.bicep
我收到以下错误消息
bicep: The term 'bicep' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again
我已经安装了二头肌扩展。
我真的不知道还能做什么,请帮忙 .
最佳答案
您可以按照此文档安装二头肌:
Install Bicep tools
您需要安装Azure CLI然后你就可以安装二头肌了:
az bicep install
要构建二头肌文件,您可以使用:
az bicep build --file main.bicep
此外,您无需在部署之前构建二头肌文件,AZ CLI 允许您直接部署二头肌文件
az deployment group create --resource-group "my resource group name" --template-file ".\main.bicep"
关于azure - 使用二头肌部署资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69283369/