0

我正在尝试packer使用以下命令从配置中构建 VM 映像:


    packer build \
        -var base_img=$base_img \
        -var client_id=$client_id \
        -var client_secret=$client_secret \
        -var tenant_id=$tenant_id \
        -var subscription_id=$subscription_id \
        -var az_cloud_environment_name=China \
        -only=azure-arm \
        packer.json

但是,我收到以下错误,我找不到它的含义以及它的分辨率是什么: Build 'azure-arm' errored: packer-azure application not set up for Azure environment "AzureChinaCloud"

有没有人见过这样的东西?

4

1 回答 1

0

仅当您使用“快速启动”设备代码流时才会发生这种情况 - 参见例如https://github.com/hashicorp/packer/issues/5034

如果您通过自己的clientIdand ,则不应该发生这种情况clientSecret。您可能没有在打包程序文件中正确使用它们

  "builders": [
    {
      "type": "azure-arm",

      "client_id": "{{user `client_id`}}",
      "client_secret": "{{user `client_secret`}}",

      "vm_size": "Standard_DS2_v2"
    }
  ],
于 2019-10-28T21:36:19.100 回答