打包程序 azure-arm vhd 生成失败,并显示身份验证错误



我正在尝试使用打包器构建VHD。我遵循了一个基本示例,但在删除临时资源组后,生成立即失败,并显示以下消息:

==> Some builds didn't complete successfully and had errors:                   
--> azure-arm: storage: service returned error: StatusCode=403, ErrorCode=AuthenticationFailed, ErrorMessage=Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.

这是我的模板:

{
  "builders": [{
    "type": "azure-arm",
    "client_id": "myclientid",
    "client_secret": "myclientsecret",
    "resource_group_name": "packer",
    "storage_account": "packerstorage",
    "subscription_id": "mysubscriptionid",
    "tenant_id": "mytenantid",
    "capture_container_name": "images",
    "capture_name_prefix": "packerimage",
    "os_type": "Linux",
    "image_publisher": "Canonical",
    "image_offer": "UbuntuServer",
    "image_sku": "14.04.4-LTS",
    "azure_tags": {
      "dept": "engineering"
    },
    "location": "East US",
    "vm_size": "Standard_A2"
  }],
 "provisioners": [{
        "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh '{{ .Path }}'",
        "inline": [
                "/usr/sbin/waagent -force -deprovision+user && export HISTSIZE=0 && sync"
        ],
        "inline_shebang": "/bin/sh -x",
        "type": "shell"
  }]
}

我已经尝试过v1存储,v2存储,lrs冗余,但此时我不确定我错过了什么。我在 resource_group_name 中设置的同一资源组下创建了存储帐户,并验证了我使用的应用程序是否继承了从我的订阅继承的所有者角色。

问题来自我使用 arch linux 软件包安装的打包程序。使用编译的二进制文件,一切都按预期工作。

相关内容

最新更新