azure - 使用二头肌部署资源

标签 azure azure-resource-manager azure-cli azure-bicep

尝试在 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/

相关文章:

azure - Arm 模板函数不适用于默认值

powershell - AzureAD PowerShell New-AzureRmRoleAssignment 不断失败

azure - 当我浏览 azure iot hub 教程时,创建结束时出现错误分区计数 4 - 为什么?

azure - UserErrorSqlBulkCopyInvalidColumnLength - Azure SQL 数据库

python - 将文件从 URL 上传到 Microsoft Azure Blob 存储

用于 Azure AD 租户/用户计数的 PHP Api

Azure Bicep - 依赖模块的计时

azure - 如何使用 az CLI 获取 Azure Log Analytics 的工作区 ID?

azure - 如何针对本地 CosmosDB 模拟器运行 Azure CLI 命令?

azure - 在 Azure 中分配/导入/颁发自动续订的应用服务证书?